cpp implementation of Path Sum II