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.
No need to add
n
when calculating distances as it is always equal to 0 [mod n]Why arrays with one element returns 0?
It is also a palindrome
You should poke lachesism, not sure he's on Discord. For me it would be a hell getting performance constraints correct in Python.
Thanks, any news about a port in Python?
Both solutions are accepted. There is no limit. I could try to port it to Python, unless lachesism wants to have a go at it. Whoever makes the translation, the algorithms used by lachesism and gpittarelli should pass in less than 2 seconds consistently when translated to Python. Any solution using a backtracking algorithm on updating and resetting colours on an array should time out. Also, smart usage of libraries such as numpy, gmpy2 and scipy should not be rewarded.
Quick question:
Is there a number on the max number of colors used? If yes, it might be worth to mention it in description.
Or is the kata accepting the following solutions for
n=6, k=6
?[1, 2, 3, 1, 2, 3]
[1, 2, 1, 2, 1, 2]
Also do you plan to port this kata in Python?
That is actually a game called Code Golfing
Simple katas like this one can be used to:
you really just wanted to flex the shortest code huh?
You can also include .strip() to remove any leading, and trailing whitespaces.
wow
Thanks for the edit
Interesting, thanks @Kacarott
For code golfers
kata got approved without this suggestion implemented
Done
Loading more items...