I am trying to solve this problem from the gym, I have found that the solution to the problem is the sum of combinations:
nc(N, K) + nc(N, K+1) + nc(N, K+2) + ... + nc(N, N)
nc(i, j) is the number of combinations i chose j
However the input sizes of
K are very large and my submission times out. Can you please advise me about a suitable approach to solve this problem?