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.
This is what I did too, I was very skeptical of myself as I continued to nest the returns but very satisfied when it worked.
An important skill in software engineering is reading the requirements thoroughly.
It doesn't filter negative values; if we have -10 and -5 as inputs, this function would return 49.
Cool Solution!
There's a really good write-up on the internet about how this works, but the gist is that bit operations to "count" neighbouring bits are applied to every pair in every byte, then added together.
This comment is hidden because it contains spoiler information about the solution
I prefer to filter out by invalid values n,m. Then there is no unneeded multiplication happening
No one is stopping you
Looking at this solution makes me want to go back to school...
Tzzzzzzzzzzz, everyone can use the Java Library.
Real pros invent the wheel again! /s
Lol, what was I thinking :D
crazy 1 line, you make me feel ashame T_T
This makes me so mad lol great job.
This comment is hidden because it contains spoiler information about the solution
No, but return value is integer anyway, so there is no possible way to return correct value using integer. We can return 0 in this case, because input data will be kind of incorrect, but I don't think it's a good way to solve the task.
Description says: "Input will always be a non-negative integer.", so we can omit handling this case
Loading more items...