+ solution
inversions done right