Leetcode Shortest Path String Escape Sequence