why are u declare another function for abs
there you can write abs(actual_rank-i)also?
and is there any way to solve in o(1) time complexity?
Biased standing code implementation
Hi @Anusree_Dey
Yes you can write it as abs(actual_rank-i) also. Time complexity O(1) is not possible as we have to traverse the array at least once.
Hope it Helps.