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 comment is hidden because it contains spoiler information about the solution
Haha, same, good to know :D
Fixed.
I did that way in my python translation. Thanks
In my opinion you desctibe 'best practice', but 'clever'.
Exactly
Everything seems to be working fine now.
Agreed, the inconsistent return types is a bad recommendation for newbies.
I totally agree with you.
Yes, complexity for linear search is O(n). Hence sorting will not be at all a good practice...
Fixed.
int upper = (int) (i >>> 32);
. That code is part ofjava.lang.Long
. In my opinion that 32 is as little magic as 8 is in this solution.I agree - returning an empty list (at least in C# and apparently Java) makes the solution much more compact/elegant. I think it could be argued that you should just return a single element list with the length/width as a member.
Let's not call it "criticism" but "suggestions". Performance isn't relevant in all cases and the increace of performance through your suggestions isn't very high. Often the performance can be increased by other refactorings like calling an database once instead of inside a loop.
@nuzyly Yes, you are completely correct.
Loading more items...