Min Path Sum & rebuild Tree