1055. Shortest Way to Form String
Description
**Input:** source = "abc", target = "abcbc"
**Output:** 2
**Explanation:** The target "abcbc" can be formed by "abc" and "bc", which are subsequences of source "abc".**Input:** source = "abc", target = "acdbc"
**Output:** -1
**Explanation:** The target string cannot be constructed from the subsequences of source string due to the character "d" in target string.**Input:** source = "xyz", target = "xzyxz"
**Output:** 3
**Explanation:** The target string can be constructed as follows "xz" + "y" + "xz".ac
Last updated