Adding n*log(n) inversion counter to check for solvability.