Separate the Digits in an Array

Solution Code

Time Complexity

O(n log M)

Space Complexity

O(log M)