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 3
- Discussions
Counting Sort 3
Counting Sort 3
Sort by
recency
|
85 Discussions
|
Please Login in order to post a comment
here's my code using python
IMHO while the target of this task is to show how pre-sorting is helpful for some other tasks, there is simple JS solution: 1) extract nums into additional array 2) sort asc this array (it doesn't matter how to do this, so I use built-in 'sort' method) 3) calc values in one loop 0..99 using results for previous array items
why my code is not correct? when i use intellij to run, result is correct, but when i copy code and paste it on hackerank is not correct? This is Kotlin Solution :