Ad
  • Custom User Avatar

    Your solution is O(n^2), it contains a loop (implicit one, in your sum and append calls), inside of your while loop.
    This kata requires O(n) solution, what means you may have more than one (implicit or explicit) loop in your solution, but not one inside of another.

  • Custom User Avatar

    Spoiler flag!

    Am getting(max buffer size 1.5 Mib)

    That's because you're printing too much stuff into console. Get rid of it.