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.
Also, even if you had to go through the array twice that's 2n wheras nlogn still takes longer for large n. And in any case 2n is O(n).
You should print the input at the start of your code! :)
Honestly, the "Input will only contain lowercase characters and whitespaces" doesn't help at all. It led me to be confused about why you wouldn't mention that white space should be ignored even though the example ignores it.
Be clear and say what you mean. Say "White spaces should be ignored". Bling4Basics answer to lead the warrior wastes people's time with looking to the comments.
Thanks for creating this in any case.
Can anyone please explain (min !== 0 && set.has(min * -1))? Specifically set.has(min * -1).
Fun Kata! Thanks g964!
Would this work for k = 100?
This comment is hidden because it contains spoiler information about the solution
Thank you for answer. Sadly, I cannot see it "This comment has been hidden."
Edit: I see it now! Thank you!
Edit2: Aha, I see now, that's very sneaky and smart. I like it. Thanks so much :)
This comment is hidden because it contains spoiler information about the solution