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'm just now seeing this! I was very new to ruby and programming haha. I flinched and then smiled looking at this code just now ;)
Well this is very clever and an extremely fast O(1) solution, but it may not be obvious to most people what this giant line of computation is doing, so probably it's not very clear. Took me about 45 seconds to realise what it was doing and then I thought "oh wow thats amazing how come I didnt think of that..."
Expressive and elegant. And it compiles to just 4 instructions (for x64 and GCC at least).
It definitely isn't. Using someone else's code without actively engaging in the process of developing an algorithm yourself is not a good practice. What if you encounter a specific problem in the future that doesn't already have an existing solution? You will likely face difficulties in finding a way forward. Additionally, if an interviewer asks you to solve a similar problem and you solely rely on someone else's code, it will significantly decrease your chances of getting the job.
This comment is hidden because it contains spoiler information about the solution
Well, if we're trying to learn how to efficiently solve actual day-to-day programmer problems, this is the best solution I'd imagine.
This comment is hidden because it contains spoiler information about the solution
For experienced C++ coders, is this a clear and easily grokable solution?
I learn new standard library methods by seeing other people's solutions WAY faster than reading by the references.
Is using using
t
better than simply using yourint i
?Nice! This is the fastest implementation based on my rough profile testing. Efficient!
This is a quite different language from C...
This comment is hidden because it contains spoiler information about the solution
Yep, came to post the same thing.
and no floats :)
Loading more items...