HackerEarth Unique sorting problem solution - TheCScience