Practice/Meta/Leetcode 1662. Check If Two String Arrays are Equivalent
CodingOptional
You are given two arrays of strings. Your task is to determine if these two arrays represent the same string when their elements are concatenated together in order.
For example, if you have ["ab", "c"] and ["a", "bc"], both would form the string "abc" when concatenated, so they should be considered equal.
true if the concatenated strings are identical, false otherwiseExample 1:
Input: word1 = ["ab", "c"], word2 = ["a", "bc"] Output: true Explanation: word1 concatenates to "abc" word2 concatenates to "abc" Both are equal, so return true
Example 2:
Input: word1 = ["a", "cb"], word2 = ["ab", "c"] Output: false Explanation: word1 concatenates to "acb" word2 concatenates to "abc" They are different, so return false
Example 3:
Input: word1 = ["abc"], word2 = ["abc"] Output: true Explanation: Both arrays contain a single identical string