When subsets are represented as bitmasks, set operations become bitwise operations:
• Union of sets and : (OR combines both)
• Intersection of sets and : (AND keeps common elements)
• Difference : (elements in but not in )
• Check if element is in set :
These operations run in time when or , making bitmask DP extremely fast.