Search
⌘K

Leetcode 1540. Can Convert String in K Moves

Compute the cyclic shift (0–25) needed at each position to turn s into t, then determine if you can assign each nonzero shift to a unique move ≤ k — identical shifts must be scheduled 26 moves apart, so the j-th occurrence of shift d needs move d + 26*(j-1); return true if the maximum required move ≤ k.


Question Timeline

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

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