Ad
  • Custom User Avatar

    Sorry, I hardly go to Codewars.

    Your solution is incorrect. The numbers are very large and your solution may recurs v*n times. So your program will get a stack overflow.

    The time complexity of the solution is O(n log n). Think more!