The 15 puzzle is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The goal of the puzzle is to place the tiles in order by making sliding moves that use the empty space.Note: not all shuffles are currently solvable.
Doesn't really make sense for an application like this one, but as an experiment it does.
try in
experiments
Here's merge sort implementation: https://github.com/forallx-algorithms/inversions-count/blob/master/inversions_count.js
Some additional info: https://www.cp.eng.chula.ac.th/~prabhas//teaching/algo/algo2008/count-inv.htm
Also look at Grokking Algorithms