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.
Clever but slow nested loops would make things faster i think... TC of this is O(nLog(n)) and TC of nested loops is O(n^2) but clever solution and quick ngl...
It seems to me that this is not the solution that the authors wanted to see
This comment is hidden because it contains spoiler information about the solution
For all the people reading the solutions and thinking that this is a "best practice", it isn't.
Yes it is clever, but it is very inefficient in runtime execution and if you get a question like this in an interview the interviewer will likely not be impressed with this answer because it doesn't show you know how to actually write an algorithm.
This is a simple way to "solve" the problem but it doesn't demonstrate any understanding of how to actually write an algorithm which is the whole point of questions like these, especially if you are practicing for interviewing.
Calling an existing function like this in a production system (when it doesn't cause a performance problem) is a good way to get your job done quickly but it executes 20X slower than writing the for loop yourself.
P.S. Read my solution that presents two algorithm options for examples of the kinds of responses interviewers are actually looking for.
This comment is hidden because it contains spoiler information about the solution
Please consider that there is a big difference between using standard arrays and Linq:
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
sometimes i feel like theres a course about LINQ out there in the cosmos, that i cant seem to find...
cause i wish i was able to read or code this like this... instead of handling nested loops...
Loading more items...