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.
Bad code.
Interesting 👌👌, for further info about TreeSet: https://www.geeksforgeeks.org/treeset-in-java-with-examples/
I advise replacing with Integer. To assign a null value instead of MaxInteger!
Integer previous = null;
ALright guys, I know I'm being slow here but why does the solution get rid of duplicates? Is it the pollLast removing the last element?
"import java.util.*;" ...What a great kata creator.
This comment is hidden because it contains spoiler information about the solution
List i = Arrays.asList(2,-5,7,7,12,Integer.MAX_VALUE);
sumConsecutives2(i);
//java.lang.NullPointerException
That throws two NullPointerExceptions with some inputs. If the input itself is Null oder if der first Integer is Integer.MAX_VALUE.