Complexity problem want better approach

i want better solution than my submission.

hello @t.prateek98

one optimisation that u can try is ,instead of storing all combinations in array , just check them in ur base case .