Radix Sort

00:00
MediumSortingCounting SortRadix
Google

Sort an array of non-negative integers using radix sort — sort digit by digit from least significant to most significant using counting sort as subroutine.

Examples

Input → [170,45,75,90,802,24,2,66]
Output → [2,24,45,66,75,90,170,802]
Input → [1,10,100]
Output → [1,10,100]
Input → [5,4,3,2,1]
Output → [1,2,3,4,5]