Awesome. My mind was blown! and the explanation is on point, too! Thanks!
what is the big-o notation for this sort algorithm, if its nlogn then its the best solution and I will hate myself for doing this longer than it should
Jesus this is too good compared to what I did , however I'm moving and learning , but where can I find and learn about such tricks, I didn't even know you can do this!
🤣 Let's go full ternary, very clever.
It is fine! But, it is also good to check input validation. Let's say I call your function with an undefined input or with a non valid input
if we want support french or other langage we have to check accented vowels like 'é' 'è' 'à' 'á' 'ù' 'ê' etc...
Love your solution. Amusing and brilliant: )
I knew it! This could be done by simply chaining string methods in a single line.
Couldn't hack it though, my solution ended up being a big procedural mess.
The code will probably crash if there is no loop. However, the kata guarantees that there will be a loop.
Is the code not going to crush if there was no loop. Just curious ? If for instance there were just 2 nodes linked but no loop ?
I didn't know you can put a function there! So cool.
This algorithm is a masterpiece, congratulations!