Skip to content

Commit 52fae03

Browse files
authored
Update minimum-domino-rotations-for-equal-row.cpp
1 parent 9bd2a83 commit 52fae03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/minimum-domino-rotations-for-equal-row.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Solution {
1515
if (intersect.empty()) {
1616
return -1;
1717
}
18-
const auto& x = *intersect.begin();
18+
const auto& x = *intersect.cbegin();
1919
return min(A.size() - count(A.cbegin(), A.cend(), x),
2020
B.size() - count(B.cbegin(), B.cend(), x));
2121
}
@@ -39,7 +39,7 @@ class Solution2 {
3939
if (intersect.empty()) {
4040
return -1;
4141
}
42-
const auto& x = *intersect.begin();
42+
const auto& x = *intersect.cbegin();
4343
return min(A.size() - count(A.cbegin(), A.cend(), x),
4444
B.size() - count(B.cbegin(), B.cend(), x));
4545
}

0 commit comments

Comments
 (0)