I've noticed that the majority of the people solving beta problems and actually ranking the kata are in the 2kyu & above range. They sometimes miss the mark in terms of determining what is novice and what isn't
I did something similar. All this people are using RegExps and prototype functions and increasing their time complexity. Also, with this method (by using an object instead of an array for the lookup table) you get O(1) lookup time for the mapped out characters.
The only downside with this is that it will use O(n) space. But that is how code works, gotta sacrifice space for time and vice versa.
I've noticed that the majority of the people solving beta problems and actually ranking the kata are in the 2kyu & above range. They sometimes miss the mark in terms of determining what is novice and what isn't
I don't think it needs O(n^2) since the smiley array size is constant. So it would be O(n) still.
Idk how this is 5kyu but was a nice problem to solve...
EZ
I did something similar. All this people are using RegExps and prototype functions and increasing their time complexity. Also, with this method (by using an object instead of an array for the lookup table) you get O(1) lookup time for the mapped out characters.
The only downside with this is that it will use O(n) space. But that is how code works, gotta sacrifice space for time and vice versa.