solution to pathSum