How to solve this gym problem

Revision en1, by motatoes, 2018-04-18 22:47:38

Dear CF

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)

where nc(i, j) is the number of combinations i chose j

However the input sizes of N and K are very large and my submission times out. Can you please advise me about a suitable approach to solve this problem?

Tags combinations


  Rev. Lang. By When Δ Comment
en1 English motatoes 2018-04-18 22:47:38 540 Initial revision (published)