Search
⌘K

Leetcode 2381. Shifting Letters II

Given a string s and many range shift operations (each shifting all characters in [start,end] forward or backward by 1), compute the final string after applying all shifts. Because shifts can be numerous, the challenge is to aggregate range updates efficiently (e.g., via a difference array / prefix-sum) to get each index's net shift mod 26 and apply it to the characters.


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.