This is a verified interview question from Ms-(microsoft). Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Roll String" covers key patterns like Strings.
"A single roll operation increments each character by one in a circular manner within the English alphabet (a-z). For example, 'a' becomes 'b', 'b' becomes 'c', and 'z' becomes 'a'. Given a string s and an array of integers roll, perform a roll operation on the first roll[i] characters of s for each element i in the array. ### Problem The problem requires writing a function that takes a string s and an array of integers roll as input and returns the resulting string after all roll operations have been performed. ### Input - string s: the string to operate on - int roll[n]: the number of items in s to roll ### Output - string: the resulting string after all roll operations have been performed ### Constraints - Each character in s is in the range ascii[a-z]. - 1 ≤ length of s ≤ 10^5 - 1 ≤ n ≤ 10^5 - 1 ≤ roll[i] ≤ length of s, where 0 ≤ i < n."
Join thousands of developers practicing for Ms-(microsoft).