NeetCode #135LC-2381MediumArrays & Hashing
← Back to All Problems

#135 · #2381 · Shifting Letters II(字母移位 II)

📌 Problem Statement & Constraints

You are given a lowercase string s and a list of shifts, each shifts[i] = [start_i, end_i, direction_i]. Direction 1 shifts the letters in s[start..end] forward by 1 in the alphabet (wrapping z to a); direction 0 shifts them backward. Return the final string. Constraints: 1 <= s.length <= 5 * 10^4, 1 <= shifts.length <= 5 * 10^4.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!