Check Similar Passwords via Cyclic Increment
Asked at Amazon · Coding Questions · Difficulty: Medium
For each pair, a new password is *similar* to the old one if you can choose a subset of the new password's indices, increment each chosen character once cyclically (`a->b`, …, `z->a`), so that the old password becomes a subsequence of the modified new password. Return `"YES"`/`"NO"` per pair.
Loading the problem…