Inversion Counting Algorithm Implementation In Python Cannot Unpack Non