Solved PathSum in java