Undo what you chose.
transcript
A subset recursion lists the sets. The third set is wrong. A flag stayed in the list.
Each call adds a flag. Then it explores the rest. Then it must remove the flag.
The list is shared by every call. A branch adds flag three. Nobody removes it. The next branch adds flag two.
Without the undo, the third set is three and two. With the undo, it is two. Every later set drifts too.
Write the undo right after the explore. The same call must restore its own change. Test with three flags.
Saving the list itself shares it. Every saved answer then ends the same. Always save a copy.
Write the choose line first. Write the undo line right after. Then write the explore line between them.
A tiny input shows the bug. Three flags are enough. Check the third subset by hand.
Restore what you change. Then every branch starts clean. Full breakdown in the lecture.