Concatenate the strings in word1 in their given order, and do the same for word2. Return true if the two resulting strings are identical, or false otherwise. The boundaries between the individual pieces do not affect the comparison.
Example 1:
Input: word1 = ["ne","et"]
word2 = ["n","eet"]
Output: trueExplanation: Both arrays form "neet". Their pieces have different boundaries, but the resulting characters match exactly.
Example 2:
Input: word1 = ["ab","cd"]
word2 = ["ab","ce"]
Output: falseExplanation: The first array forms "abcd", while the second forms "abce". Their last characters differ, so return false.
Example 3:
Input: word1 = ["abc"]
word2 = ["ab"]
Output: falseExplanation: The arrays form "abc" and "ab". One has an extra character, so they are not equal.
Constraints:
- Each array contains between
1and1000strings. - Each string contains between
1and1000lowercase English letters. - The total number of characters in each array is at most
1000.