Implemented invert(..) to build suffix array from inverse