SnapChat 面经

原帖地址:一亩三分地

刚面的,还不知道结果。
Given a list of integers: {4, 3, 1}; // assume no duplicates
and a target sum: 5
print out all sequences of integers from the list that sum to target
[4, 1]
[3, 1, 1]
[1, 4]
[1, 3, 1]
[1, 1, 3]
[1, 1, 1, 1, 1]
[4, 1][3, 1, 1][1, 4][1, 3, 1][1, 1, 3][1, 1, 1, 1, 1]