Given an array, arr[] of integers. The task is to sort the elements of the given array in the increasing order of their modulo with 3 maintaining the order of their appearance.
Expect time complexity O(N) and the interviewer said that it can be done in only one traversal.
Expected space complexity O(1).