Some problems ask you to visit all cities, assign all workers, or select from all elements. With items, there are possible subsets. Tracking each subset as a state sounds expensive, but for small , it's practical.
I'll show you how bitmasks represent subsets as integers. You'll learn to read, write, and iterate over subsets using bit operations. Then you'll apply this to classic problems: Traveling Salesman, Assignment, and Subset Partitioning. By the end, you'll know when bitmask DP (dynamic programming) applies and how to implement it.