Minimum Cost to Convert String II
Run Floyd-Warshall over every distinct rule string, then let a prefix DP choose where to cut source and target into convertible pieces.
Run Floyd-Warshall over every distinct rule string, then let a prefix DP choose where to cut source and target into convertible pieces.