Two String Lists Spell the Same Word
Each list holds pieces of a string. Return True if joining the pieces of word1 in order gives the same string as joining the pieces of word2 in order, otherwise False.
Example 1
word1 ["ab","c"]
word2 ["a","bc"]
returns true
Both join to abc.
Example 2
word1 ["a","cb"]
word2 ["ab","c"]
returns false
acb is not abc.
Constraints
1 <= len(word1), len(word2) <= 10- Each piece is a non-empty string of lowercase letters
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.