3 ms·
If we're targeting O(n log n), we could just sort the array and examine the number of times the minimum entry appears.
by pronoiac 12y ago
If we're targeting O(n log n), we could just sort the array and examine the number of times the minimum entry appears.
- dcre 12y agoThe answer is not always the lowest number, e.g., if it appears late in the list.
- pronoiac 12y agoAh! I missed the "whose indices are bigger" item in the description.
- oltmang 12y agoCrap, me too! It also would've helped if he provided an example where the answer wasn't also the min.
- jacksontale 12y agoYeah, you are right, the example number list in the post was not that awesome. If I am free at any time, i will modify the example. Just refining the diagram will be quite painful.