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.
I was wondering that too, just learnt that chars can be compared.
That being said, how do they do this?
For eg, why does 3+2 = 101?
It's naïve to think there are only 26 different letters, even using english.
I did the solution with over 40 lines of code and time complexity was still O(N log (n) ), so looking at this solution is embarrasing
Why do you apply ToLower on each character? String has that method too. Meaning you could've started with str.ToLower() and omitted that Select call.
I do not know what "Deadfish" is in general but this solution seems to go against Open/Closed principle. If you ever have to expand available commands you will need to modify the logic of your code which is not desirable. Instead, you can use interfaces along with a dictionary to be able to add new commands. If you will need to add new options you will add the to the dictionary and therefore not modify the logic.
Great minds think alike! This is pretty much identical to what I came up with!
tbh yeah TC is O(nLog(n)) and SC is O(n) when it can be done with nested loops with TC of O(n^2) and SC of O(1) but seems like less code
Well this code has worse TC and SC but I like it, less code buff i guess but may i ask is TC O(n log(n))? cause it uses OrderBy and why use Queue?
I love how elegant this solution is
May I ask why you used a Queue? Is there any benefit over a traditional list or array?
This comment is hidden because it contains spoiler information about the solution
just stepped through your code with pen and paper and this is so satisfying.
Просто лучший!
This comment is hidden because it contains spoiler information about the solution
I had a strange issue where my code would pass the test, but fail the submit with the random tests. Sometimes it would not fail. I think the issue had to do with my initial conditional checking if the string was empty and index was not 0 or greater than the array length. But I tried a lot of different combinations, and it still failed sometimes and didn't others. Now that I see the rest of the answers, I don't see why mine would have failed at all. Does anyone have insight on this?
Loading more items...