rewrite leetcode simplify paths