here is my ideone link:http://ideone.com/GzCnP6I saw some solutions online,all of them had a same approach but my approach is giving TLE for 31st test case.Your help will be appreciated.
There is no problem with this name - do you mean "HYPNOS"?
pow
myset
ans
hpy
@tjm made the changes you suggested but still getting TLE at 31st test case.Another query that i have is why is the set empty when declared globally?
It is empty because nothing is ever inserted into it.
Thanx man. Got an AC......