Please read how to post code here: markdown formatting (otherwise your code loses all its indentation) and mark your post as having spoiler content next time. You're using a global var there, so it'll fail when your function is called several times in a row.
From the link hobovsky told you:
Check if your solution passes two successive calls with different inputs. It's sometimes the case that the solution contains some global variables or static members and a stale state is carried over from one invocation to another.
I just checked my solution and it still works, tests also seem to be OK.
I am going to close the issue as invalid, and you could just go through the FAQ I linked above and try to find the problem with your solution. if you are sure you are 100% correct, post your code here.
Please read how to post code here: markdown formatting (otherwise your code loses all its indentation) and mark your post as having spoiler content next time. You're using a global var there, so it'll fail when your function is called several times in a row.
From the link hobovsky told you:
.
I just checked my solution and it still works, tests also seem to be OK.
I am going to close the issue as invalid, and you could just go through the FAQ I linked above and try to find the problem with your solution. if you are sure you are 100% correct, post your code here.
Please see if anything here helps: https://docs.codewars.com/training/troubleshooting/#works-but-no