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.
I agree. Sorting would actually be O(n log n). I just iterate through, count the students who are on time and compare with K. However, I do like the a[k - 1] idea.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Angry Professor
You are viewing a single comment's thread. Return to all comments →
I agree. Sorting would actually be O(n log n). I just iterate through, count the students who are on time and compare with K. However, I do like the a[k - 1] idea.