| 2 | #include<string.h> |
| 3 | |
| 4 | int main(){ |
| 5 | |
| 6 | int a[26],max=0,ascii; |
| 7 | char c[10]; |
| 8 | |
| 9 | for(int i=0;i<26;i++) |
| 10 | scanf("%d",&a[i]); //reading inputs and storing them in the integer array |
| 11 | |
| 12 | scanf("%s",c); //reading the string |
| 13 | |
| 14 | int len=strlen(c); //calculating length |
| 15 | |
| 16 | for(int i=0;i<len;i++){ |
| 17 | |
| 18 | ascii=c[i]-97; //finding out the integer equivalent in our integer array from each character of the string to get the maximum height |
| 19 | |
| 20 | if(a[ascii]>max) |
| 21 | max=a[ascii]; //stores the maximum height |
| 22 | |
| 23 | } |
| 24 | |
| 25 | printf("%d",len*max); //printing the result |
| 26 | return 0; |
| 27 | |
| 28 | } |
nothing calls this directly
no outgoing calls
no test coverage detected