Sorting in linear time


I followed the hint video’s algorithm but I can’t get the required result.
Help me resolve it please.

Please help me with this doubt.