Given an array of non-negative integers and two integers, customBase and k, implement a custom radix sort to sort the array. The custom radix sort should use the customBase and should not consider more than k digits for sorting. If a number cannot be represented in the customBase within k digits, it should be placed at the end of the sorted array in their original order.
Explanation: The array is sorted using a custom radix sort with customBase = 10 and k = 3
Explanation: The array is sorted using a custom radix sort with customBase = 10 and k = 4
Non-comparison based sorting
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak