Skip to content

Commit 3d104dc

Browse files
authored
Update count-pairs-of-equal-substrings-with-minimum-difference.cpp
1 parent 5a34193 commit 3d104dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

C++/count-pairs-of-equal-substrings-with-minimum-difference.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ class Solution {
55
public:
66
int countQuadruples(string firstString, string secondString) {
77
vector<int> lookup1(26, -1);
8-
for (int j = size(firstString) - 1; j >= 0; --j) {
9-
lookup1[firstString[j] - 'a'] = j;
8+
for (int i = size(firstString) - 1; i >= 0; --i) {
9+
lookup1[firstString[i] - 'a'] = i;
1010
}
1111
vector<int> lookup2(26, -1);
12-
for (int a = 0; a < size(secondString); ++a) {
13-
lookup2[secondString[a] - 'a'] = a;
12+
for (int i = 0; i < size(secondString); ++i) {
13+
lookup2[secondString[i] - 'a'] = i;
1414
}
1515
int result = 0, diff = numeric_limits<int>::max();
1616
for (int i = 0; i < 26; ++i) {

0 commit comments

Comments
 (0)