Inversion Count added
 the KMP algorithm