Roll the String

Company: PayPal SWE Intern_30oct

Difficulty: medium

Problem Statement

Roll the String Problem Description A single roll moves a character one step forward in the English alphabet, wrapping around: 'a' becomes 'b' , 'b' becomes 'c' , and 'z' becomes 'a' . You are given a lowercase string s and an array roll . For each i in order, roll the first roll[i] characters of the string once. Each operation acts on the string left behind by the previous one. Print the string that remains after all the operations. Function Description Complete the rollTheString() function in the editor. It takes the following 2 parameters and returns a string. s: the string to operate on roll: roll[i] is how many leading characters the i-th operation rolls Input Format Note: use this input format if you are testing against custom input or writing code in a language where we do not provide boilerplate code. The first line contains the string s. The second line contains n, the size of roll. Each of the next n lines contains one integer roll[i]. Output Format Print the resulting string