Search
⌘K

Leetcode 1625. Lexicographically Smallest String After Applying Operations

Given an even-length digit string, repeatedly apply two operations—add a (mod 10) to digits at odd indices and rotate the string right by b—to produce the lexicographically smallest reachable string. The core challenge is to efficiently explore the finite state space of strings (via BFS/DFS with cycle detection and modular/rotation periodicity optimizations) to find the minimum.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.