Better version of  Path Sum