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.
My code works perfectly on python and I get the right answer but apparently when pasting it here it says I get something else.
Example:
CodeWars:
duplicate_encode("ya(ew(lzQ)") - wrong
"))))))))))" should be "(()(()(((("
The same code not on CodeWars:
"(()(()(((("
I have checked a bunch of errors and I always get the right answer yet on COdeWars it says I got it wrong, plz fix.
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:
This comment is hidden because it contains spoiler information about the solution
.
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
My code works perfectly on python and I get the right answer but apparently when pasting it here it says I get something else.
Example:
CodeWars:
duplicate_encode("ya(ew(lzQ)") - wrong
"))))))))))" should be "(()(()(((("
The same code not on CodeWars:
"(()(()(((("
I have checked a bunch of errors and I always get the right answer yet on COdeWars it says I got it wrong, plz fix.