has path sum reimpl