Blinkit frontend utilities may expose the same operation through multiple calling styles. Implement an add function so that both add(a, b) and add(a)(b) return the sum of a and b.
The curried form must return a callable after receiving the first operand. The returned callable accepts the second operand and produces the same numeric result as the direct form. Do not modify global state, and each invocation must create an independent closure.
Implement add(a, b=None) in Python:
b is provided, return a + b.b is omitted, return a callable that accepts one argument and returns a + b.def add(a, b=None):