Example #1
0
int main(int argc, char const *argv[]) {
  string tree = "2 3 6 -3 # # -1 # # -4 2 # # 3 1 -5 # # 2 # # 4 # # 4 -3 7 -3 # # -2 # # 2 # # 2 5 # # 1 # #";
  TreeNode *root = deserialize_tree(tree);

  Solution sol;
  auto result = sol.all_path_sum(root, 5);
  for (auto v : result) {
    copy(v.begin(), v.end(), 
      ostream_iterator<decltype(v)::value_type>(cout, " ")); 
    cout << '\n';
  }

  return 0;
}