backtracking with array buffer to solve combination sum