foobar is unfolded incorrectly in our answers, time complexity should be O(2^n) and not O(n*2^n).
foobar