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.
People often upvote the solution they understand or the one similar to what they did, so it's more of the most popular solution rather than most clever or fastest
Nested for loop on the same set means n^2 time complexity. Why? Search for Big-O notation on Youtube, there are some materials. How to use the map?
This way
Why not? I would make them inline though. But i'm pretty sure that compiler will optimise it as inline functions
Can you please explain more ?
I really don't think you should make two extra functions for determining if an integer is even or odd.
Why are all top solutions on this website the naive solution? This runs in O(n^2) and is simple to optimize with a hash map. Explain how having to potentially do 2^64 operations to solve a basic problem is "Best Practice" or "Clever"?
This comment is hidden because it contains spoiler information about the solution