Insertion sort problems on hackerrank