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.
Although you can easily index an array with
-1, 0, 1
too...I think main idea of this kata is write own method like .permutation.
First, <=> operator returns -1, 0, or 1.
i.e.)
scores[:P2] <=> scores[:P1]
returns-1 if scores[:P2] < scores[:P1]
0 if scores[:P2] == scores[:P1]
1 if scores[:P2] > scores[:P1]
Because array index starts from 0, adding 1 is necessary to make a correct index (0, 1, or 2).
You don't need matrices.