summaryrefslogtreecommitdiff
path: root/string/duval.cpp
diff options
context:
space:
mode:
authorMZuenni <michi.zuendorf@gmail.com>2023-03-01 11:36:26 +0100
committerMZuenni <michi.zuendorf@gmail.com>2023-03-01 11:36:26 +0100
commit12afe719ce268bb10aa93a910079a44eb08999b8 (patch)
tree0937a117287eebe3942e0506d27143eff4980d09 /string/duval.cpp
parentad8456f7c5d44d3c647b3a368050a5d2f39ae3c3 (diff)
removed trailing whitespaces and use more structured bindings
Diffstat (limited to 'string/duval.cpp')
-rw-r--r--string/duval.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/string/duval.cpp b/string/duval.cpp
index 6d80e95..bf36cce 100644
--- a/string/duval.cpp
+++ b/string/duval.cpp
@@ -15,7 +15,7 @@ vector<pair<int, int>> duval(const string& s) {
int minrotation(const string& s) {
auto parts = duval(s+s);
- for (auto e : parts) {
- if (e.first < sz(s) && e.second >= sz(s)) {
- return e.first;
+ for (auto [l, r] : parts) {
+ if (l < sz(s) && r >= sz(s)) {
+ return l;
}}}