Path Sum none recursive solution