Problem

One left-to-right bubble pass: swap adjacent if out of order; return result.

Examples

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