Problem

Return how many swaps selection sort would perform on arr.

Examples

  • countSwapsSelection([3, 2, 1]) -> 2
  • countSwapsSelection([1, 2, 3]) -> 0
Compile and test (Ctrl+Enter)