#1662
Easy Algorithms Check if two string arrays are equivalent
Array String
86.1% acceptance
Feb 25, 2026
3152
205
Given two string arrays word1 and word2, return true if the two arrays
represent the same string, and false otherwise.
A string is represented by an array if the array elements concatenated in
order forms the string.
Solution
Rust
Time O(1)
Space O(1)
impl Solution {
pub fn array_strings_are_equal(word1: Vec<String>, word2: Vec<String>) -> bool {
word1.concat() == word2.concat()
}
}