Company: Oracle_16nov
Difficulty: medium
Roll the String Problem Description To roll a lowercase letter means to replace it with the letter that follows it in the alphabet, where the alphabet is treated as a circle: a turns into b , m turns into n , and z turns back into a . You are given a string s of lowercase English letters and a list of n operations roll[0], roll[1], ..., roll[n-1] . Operation i rolls every one of the first roll[i] characters of the string once; the characters after that prefix are left alone. The operations are carried out one after another in the given order, and each one works on the string left behind by the operations before it. Return the string that remains when all n operations are done. Complete the function rollTheString(s, roll) . Input Format The first line contains the string s . The second line contains an integer n , the number of operations. The third line contains n space-separated integers roll[0] roll[1] ... roll[n-1] . Output Format Print the final string on a single line. It always h