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.
You're right: most solutions here are O(n^2), but this one is O(n). The code duplication makes it read like a C program, so initially I was surprised.
You can work with as many languages as you like, but indeed, working with languages is missing some support:
Yeah I'm really interested in this feature as well
Hi, Is it possible to work on two different languages at the same time? Meaning have a different kata ranking for each language, so that you can tackle different level's of problems for each language? And then if you complete a kata for one language, would it show it's completed for the other language?
I really thought my solution would be much faster because I don't use pow at all, I just use a few modulus operations for each subroutine call, but my solution doesn't seem any faster (maybe slower). :)
Whoever implement the pow funtion did an amazing job!!!
Your solution was similar to mine, but I like yours better (your approach to create the initial string was more straightforward)
This is the fastest solution I spotted so far, since I believe it is O(n). It does not do any comparisons, just counts the number of 0's, 4's, 9's, 6's as it inspects the string in basically one pass. Most of the solutions which compare between all the different combinations would be much slower, right? Please let me know if I'm wrong. (of course, this solution would probably require more memory, if that is a consideration)
he means -2 + 1 = -1, this sum is less than 6,
the largest sum (when adding adjacent indices is 6 = 4 + (-1) + 2 + 1)