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.
This one is very clever. Good job!
definitely the most readable solution, much like 👍
Not possible, because 'x' takes the first element of (sorted) queue.
But the list 'u' is not needed : never read except his size. Maintains a counter or decreasing 'n' will be enougth
And why in the hell a check is done on queue in loop condition, it grows constantly (2 add for 1 remove)
Summary : "while(true){...}" + "if(n--==0) return x;" instead of "u.Add(x);"
Except the gready pitfall, it's nice and clever
Which would be more efficent?
1.Sortedset + List
2.Hashset + List with sort() at the end before returning
Just wondering.
You can use only one variable as Y instead of Y and Z, because Z = Y + X. So, it can improve your code just a little :)
I like the volumeSoFar and totalVolume names. Very clear.
Thanks for doing my Kata!! Haha... I know the feeling, happens to me all the time!
I apologize for my stupidity. I was so annoyed by my off-by-one error, I couldn't see the simple solution anymore! :-)
Great kata and good test cases!!
Doesn't this solution return a false positive for num1 = 111 and num2 = 22?
This comment is hidden because it contains spoiler information about the solution
Total respect, the namespace is added, and the code is trimmed now.
Should add the 'using System.Collections.Generic;' to the setup, because the signature already needs it. The setup should compile out of the box imho.
I've spotted the enterprise programmer!
The Test case function for case 2 has been duplicated but not renamed. Please rename the second function to case 3.
What if there is more than one sharp number?
Loading more items...