https://jzleetcode.github.io/posts/leet-1055-shortest-way-form-string/