Ad
  • Default User Avatar

    I see, got it!

  • Default User Avatar

    I'm sorry too! You are right but it is not the question. No number x gives exactly m=6540715897 for n=48 hence the answer -1. Am I clear enough?-)

  • Default User Avatar

    Sorry, I was a little unclear.
    What I meant is that there seems to be a range of x that would satifisfy the conditions.
    48 choose 11 produces 2311801440
    48 choose 37 gives 22595200368
    Every x between 11 and 37 should produce enough combinations.

  • Default User Avatar

    I think you don't have correctly understood the kata. The description says:

    In other words we must find x such as n choose x = m (1) for a given m and a given n

    You have to solve an equation not an inequation. 37 choose 11 gives 854992152, not 6540715897

  • Default User Avatar

    I think you don't have correctly understood the kata. The description says:

    In other words we must find x such as n choose x = m (1) for a given m and a given n

    You have to solve an equation not an inequation. 48 choose 11 gives 22595200368, not 6540715897 and 34 choose 4 gives 46376 not 5985.

    BTW thanks for the links!

  • Custom User Avatar

    C#

    When m=6540715897 and n=48 it expects -1, but the answer should be 11. Same problem in Random Tests, m=5985 and n=34 expects -1, but the answer is 4.

    http://www.wolframalpha.com/input/?i=%2848+choose+11%29+%3E+6540715896
    http://www.wolframalpha.com/input/?i=%2834+choose+4%29+%3E+5985