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.
no, the sort process is only converting string to int for the purpose of comparing two strings. the original strings are left unconverted and simply reordered in the list.
This is a lot cleaner than my successful hamfisted bucket sort.
Another major speedup can be achieved by creating an output string and only calling print() once, since stdout operations seem to have a high cost compared to string concatenation. Specifically there seems to be a significant delay after writing to stdout.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Big Sorting
You are viewing a single comment's thread. Return to all comments →
no, the sort process is only converting string to int for the purpose of comparing two strings. the original strings are left unconverted and simply reordered in the list. This is a lot cleaner than my successful hamfisted bucket sort.
Another major speedup can be achieved by creating an output string and only calling print() once, since stdout operations seem to have a high cost compared to string concatenation. Specifically there seems to be a significant delay after writing to stdout.