I remember seeing it once in Leetcode but not sure which one. Here's the problem.
I have a list ['a','b','c']
. And through permutation, I want to have a result of all kinds of possible list combinations with the give list.
Expected
result = [['a'],['b'],['c'],
['a','b'],['b','c'],['a','c'],
['a','b','c']]
if ['a','b','c','d']
, it should be
result = [['a'],['b'],['c'],['d'],
['a','b'],['a','c'],['a','d'],['b','c'],['b','d'],['c','d'],
['a','b','c'],['a','b','d'],['a','c','d'],['b','c','d'],
['a','b','c','d'],
]
I would really appreciate if I can get any inspiration from you guys.