Ad
  • Custom User Avatar

    No?

  • Custom User Avatar

    I am just guessing that if the input is an array of integers where all the integeres are different, then the speed would drop significantly?

  • Default User Avatar

    If it happens every time than you solution is too slow.

  • Default User Avatar

    What do you mean by limited? It works for any input.

  • Custom User Avatar

    Kind of nice Kata. However it is only solvable with a certain assumption on the input set. Since the values used are limited the caching is a viable option. However this is not a generic solution for any type of input. Thus I would suggest that it actually states that the input ranges of values are limited.