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.
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
i completely agree too, just recently starting to do C#, about a few months now, for college, but i've done python for years and i just feel like it's just a gimick. It's just used to show off and not for practicality. Glad some people agree with me!!!
Doesn't help for people trying to learn too, usually if i see "using Linq;" i just ignore it cause it's someone trying to do a 1 liner
Cool, clever use of recursion, but I would object putting this into production.
Loading more items...