Grade Down (Monadic) R←⍒Y

Y may be any array of rank greater than 0 but may not contain namespaces. R is an integer vector being the permutation of ⍳1↑⍴Y that places the sub-arrays along the first axis in descending order. For the rules for comparing items of Y with one another, see Grade Up (Monadic).

⎕IO is an implicit argument of Grade Down.

Examples

      22.5 1 15 3 ¯4
1 3 4 2 5
      M
2 3 5
1 4 7

2 3 4
5 2 4

2 3 5
1 2 6
      M
1 3 2

Note

Character arrays sort differently in the Unicode and Classic Editions.

      M
Goldilocks
porridge   
Porridge   
3 bears 
Unicode Edition Classic Edition
      ⍋M
2 3 1 4
      ⍋M
3 1 4 2
      M[⍋M;]
porridge
Porridge
Goldilocks
3 bears
      M[⍋M;]
Porridge
Goldilocks
3 bears
porridge
      pb
6 3
      pb
┌────────┬─────┬───┐
Rivers  Jason554
├────────┼─────┼───┤
DaintreeJohn 532
├────────┼─────┼───┤
Rivers  Jason543
├────────┼─────┼───┤
Foad    Jay  558
├────────┼─────┼───┤
Scholes John 547
├────────┼─────┼───┤
Scholes John 535
└────────┴─────┴───┘
      pb
5 6 1 3 4 2