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.
The problem you're all running into is that there's a limit to how big numbers can be in Javascript. There are several libraries that handle this though, and one is even supported by HackerRank so you can solve problems like this. Check it out here: https://www.hackerrank.com/environment (scroll down to Javascript)
Here's my oneliner solution (minus the library require):
Big Sorting
You are viewing a single comment's thread. Return to all comments →
The problem you're all running into is that there's a limit to how big numbers can be in Javascript. There are several libraries that handle this though, and one is even supported by HackerRank so you can solve problems like this. Check it out here: https://www.hackerrank.com/environment (scroll down to Javascript)
Here's my oneliner solution (minus the library require):