CTCI 9.4 get all subsets