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.
to create the dictionary only once, you could write like in the kumite
How it can be marked as a "best practice"?? O(N * N * log N)
How it can be voted as "best practice" if this approach is O(n * lg n)? it can be solved with O(n)
How it can be marked as "best practice" if this solution at least makes sort twice??
Nice solution
This is exactly how I first wanted to solve it! But if a guy had 3 names, it would be first and middle name letters, so I abandoned it and made a huge mess instead...
Simplified solution, but the code traverse four times the string.
i can't understand why you generated a range of numbers starts with 0 and ends with the Length minus 1 ?
Duplicate suggestion
Used the same solution:
Basically you just have a nested if clause, after a condition comes another condition, after the false of the inner If-Clause u contiue with the false of the first If-Clause
Ahhh I knew there was a cooler Linq'y way to solve this. Taking notes
I mean he could have just constructed a new array with the length of 100 and added 1 to each element to get up to 100 and then used the reduce method, but as you can probaly already tell that's way more work than just hard-coding the 5050. I did something similar in my code
why is this best practice if the sum 5050 is hard coded ? isn't a more general solution wherein the sum for the first 100 positive integers 0 included is calculated first the way to do it ?
Very concise, however there are at least 4 heap allocations here from creating new strings.
This solution should not be listed best practice.
Smart, i like it
Loading more items...