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.
Damn that thing is old
this approach is not good because it will take so much process time
This answer was probably made before the introduction of let,const
This comment is hidden because it contains spoiler information about the solution
https://docs.oracle.com/javase/8/docs/api/java/util/Set.html
"A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element."
Very cool! Just learnt something new!
You can check whether an item exist or no in an array, by checking its index, so if the index ( == -1) OR in other way (< 0), it means that this item doesn't exist, so the logic here is to push this item to the output array.
why < 0 though?
I didnt know you can do that, very Cool!
brilliant~~
nope
Good solution. Even more you could have saved some cpu time had you used TreeSet instead of HashSet. In this case you don't need the line -> Arrays.sort(resultArray). And yes I'm aware that TreeSet takes more time than HashSet but still thats better for this case.
This is a way to arounding up to nearest integer. For example 3/2 mast be 2, not 1.
Is there a reason/efficiency of using a new Array constructor instead of just initalizating a array literal?
You are not decreasing r by 5 but 4 that's the part I am having diffuculty to understand.
Loading more items...