Given an array of non-negative integers, sort the array based on the frequency of the least significant digit of each number in the entire array. If two numbers have the same frequency of the least significant digit, sort them based on the value of the least significant digit itself.
Explanation: The frequency of the least significant digit in the entire array is counted and sorted accordingly.
Explanation: The frequency of the least significant digit in the entire array is counted and sorted accordingly.
Non-comparison based sorting
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak