No. There is no problem in your methodology. But I think you assumed that arr <= arr ? Have your read description carefully?
arr <= arr
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.