Max Min Discussions | Algorithms | HackerRank
  • + 2 comments

    New to hackerrank.

    The way Hackerrank is ranking in this problem seems fundamentally flawed.

    I wrote my answer fully in C writing a the sort algorithm myself and I got a few 'timeouts' when submitting the answer because it was not fast enough. I could have tried to make my sort faster with a quicksort of something but just rewrote the code in java and use the Arrays.sort() and just flew through. A few thoughts:

    • Unless Hackerack has specific timer benchmarks for every language provided that are precisely tuned for every language this problem will rank the answer different for every language or sort implementation.

    • I think bare C lacks a standard sort library, so to solve this problem one has to roll their own which can quickly turn into some testcases timing out. The difficulty of solving this in C could be substantially greater than in other languages.