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.
I cant figure this out "Note that any element of the array can only be counted in one Perfect Pair. Also if there are multiple correct answers, return the smallest one.", I dont understant why the answer to the following case is 10 and not 15.
kata.Pairwise(new int[]{0, 0, 0, 0, 1, 1},1);
if in the previous case the answer is 10, then what is the answer of the following:
kata.Pairwise(new int[]{0, 0, 1, 1, 0, 0},1);
The same thing happened to me, you have to validate when the rank goes through 0, for example (-5 to 1), (-1 to 4), (4 to -2), (7 to -4), in all that cases you dont have to count the rank 0.