Mike and hashtrick


why we displaying sorted vector in it?

@tishya_goyal,
We are sorting on the basis of map values of elements, which was assigned incrementally to elements.
The given O(N^2) algorithm ensures to count the number of unique elements before each element. Thus sorting on the basis of assigned indexing will ensure the same.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.