Stuck in http://www.spoj.com/problems/ORDERSET/
Here is the problem
Here is my solution
I keep on getting WA. In another attempt I tried to store values in map for checking duplicates(i won't insert when duplicates) but I got TLE. Can anyone help me in finding out the bug. Thanks.
Codeforces Round 946 Solution Discussion