Ad
  • Default User Avatar

    Are the tests timing out? This kata can be solved without recursion and modification of the original array.

  • Default User Avatar

    This solution is too slow and probably times out. Values of r in excess of 1 million are used in tests. Modifying the original array will not work. Need to figure the array index for any given r. I solved it by writing out the results for R from 1 to 35 and looking at the sequence. It has something to do with powers of 2.

  • Default User Avatar

    Needs test cases