Ad
  • Custom User Avatar

    Thanks for your answers. I was trying various methods for solving this problem. And wondered about recursion.

  • Custom User Avatar

    Is there anyone who could make recursive solution for this case? I have tried but getting RecursionError, because of the limit.