class Solution {
public boolean arrayStringsAreEqual(String[] word1, String[] word2) {
String str = "";
String str1 = "";
int next1 = 0;
int next2 = 0;
while (next1 < word1.length) {
str += word1[next1];
next1++;
}
while (next2 < word2.length) {
str1 += word2[next2];
next2++;
}
return str1.equals(str);
}
}
leetcode 1662. 检查两个字符串数组是否相等
最新推荐文章于 2022-08-28 09:32:02 发布