• + 3 comments

    From what I understand looking at the examples, it seems like the person who wrote the statement doesn't know what a subset is. When he says "all subsets of S", you should read "all elements in S".

    So if S={1,2,4} the 'subsets' are 1, 2 and 4, instead of {1}, {2}, {4}, {1,2}, {1,4}, {2,4} and {1,2,4}.

    Edit: I can now confirm that I was wrong, the problem is indeed about subsets. As long as you ignore any mention of 'U' in the problem statement you should be fine. Refer to gdisastery answer here: https://www.hackerrank.com/contests/w22/challenges/submask-queries-/forum/comments/168407