Created
September 28, 2021 07:02
-
-
Save r14152/c6a17e7b6b2c9fc38ea84a1e9ac6dbeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<cstring> | |
using namespace std; | |
int main() | |
{ | |
int t,i=0; | |
cin>>t; | |
while(i<t){ | |
int n; | |
cin>>n; | |
string str; | |
int arr[n+1],j=0; | |
cin >>str; | |
int temp[n+1],l=0; | |
for(int k=0;k<n;k++) | |
{ | |
temp[l] = str[k]-'a'; | |
l++; | |
} | |
while(j<n) | |
{ | |
cin>>arr[j]; | |
for(int l=0;l<arr[j];l++){ | |
temp[l] +=1; | |
if(l>25) | |
break; | |
if(temp[l]>25) | |
temp[l]=0; | |
} | |
j++; | |
} | |
string ptr=""; | |
j=0; | |
string alphabet = "abcdefghijklmnopqrstuvwxyz"; | |
while(j<n){ | |
ptr +=alphabet[temp[j]]; | |
j++; | |
} | |
cout<<ptr<<endl; | |
i++; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment