We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Counting Sort 1
- Discussions
Counting Sort 1
Counting Sort 1
Sort by
recency
|
604 Discussions
|
Please Login in order to post a comment
Python Code
Kotlin
Python solution:
(lang = node.js) Adding this note in case anyone else runs into this issue. I was getting a runtime error where I couldn't pass test case 4 but all others passed. Test case 4 is an unusually large array of integers, like 100,000 or so. The issue wasn't with the loop itself, but rather because I was setting the countArr size with Math.max(arr) instead of setting it to 100 manually.
Java Solution
public static List countingSort(List arr) {