Skip to content

Commit 709a338

Browse files
authored
Update check-if-string-is-transformable-with-substring-sort-operations.cpp
1 parent b9406ec commit 709a338

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/check-if-string-is-transformable-with-substring-sort-operations.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ class Solution {
1010
}
1111
for (const auto& c : t) {
1212
int d = c - '0';
13-
if (idx[d].empty()) {
13+
if (empty(idx[d])) {
1414
return false;
1515
}
1616
for (int i = 0; i < d; ++i) { // a char can be moved left to the current position if it meets no smaller one
17-
if (!idx[i].empty() && idx[i].back() < idx[d].back()) {
17+
if (!empty(idx[i]) && idx[i].back() < idx[d].back()) {
1818
return false;
1919
}
2020
}

0 commit comments

Comments
 (0)