Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
The one example you showed using f string doesn't seems to work for me.
Update : sorry I should have put double quotation "needle" instead of 'needle'
Helps to visualise this using pythontutor.com - the issue is that you are reversing the list in order to remove the later occurrences, but that doesn't handle the fact that when you remove items, they are removed from the beginning of your list and thus the items in your working list shift.
For example:
After you reverse your list, index 0 is 30, index 1 is 33. Upon evaluating index 0 (integer 30), it removes all but the last occurrence of 30, which actually removes the first item in your list.
In the next loop, index 0 is 33, but the loop is now looking at index 1, so 33 gets skipped.
Talk for yourself. I've learnt great part of what I know in programming by dissecting (very often unreadable) code of power users on CW.
Actually it isn't. Write your code as legibly as possible and not as short as possible. And try to solve some hard problems insteat of solving easy problems in one line.
That's a good way to learn ;)
Indeed it's an easy one. It's a very old kata (8 years), elders are used to saying old kata, easy kata ;)
hahahahahahaa, same is happeing with me but i got a hint so i have see the examples well, right?
This comment is hidden because it contains spoiler information about the solution
If your programming ain't good, at least you should read the tags
Yes but it's still a puzzle
Use spoiler flag next time, please.
Change python version to 3.8 in the dropdown above the solution editor.
@Chrono79 is it possible to disable 3.6? Or otherwise maybe check
sys.version
? I suppose most people won't run into it since 3.8 is the default (?)Seems to me like the sane thing for codewars to do would be to automatically disable 3.6 where 3.8 is the default
This comment is hidden because it contains spoiler information about the solution