Skip to content

Commit 99d710a

Browse files
authored
Update check-if-strings-can-be-made-equal-with-operations-ii.cpp
1 parent f034b4a commit 99d710a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

C++/check-if-strings-can-be-made-equal-with-operations-ii.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
class Solution {
66
public:
77
bool checkStrings(string s1, string s2) {
8-
vector<vector<int>> lookup1(2, vector<int>(26)), lookup2(2, vector<int>(26));
8+
vector<vector<int>> cnt1(2, vector<int>(26)), cnt2(2, vector<int>(26));
99
for (int i = 0; i < 2; ++i) {
1010
for (int j = i; j < size(s1); j += 2) {
11-
++lookup1[i][s1[j] - 'a'];
11+
++cnt1[i][s1[j] - 'a'];
1212
}
1313
for (int j = i; j < size(s1); j += 2) {
14-
++lookup2[i][s2[j] - 'a'];
14+
++cnt2[i][s2[j] - 'a'];
1515
}
1616
}
17-
return lookup1 == lookup2;
17+
return cnt1 == cnt2;
1818
}
1919
};

0 commit comments

Comments
 (0)