solved hackerrank's designer pdf viewer problem
Signed-off-by: ayham <altffour@protonmail.com>
This commit is contained in:
parent
368e5d2f78
commit
cc5507c727
|
@ -0,0 +1,13 @@
|
||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int max_height = -1;
|
||||||
|
vector<int> heights(26);
|
||||||
|
string word;
|
||||||
|
for (int i = 0; i < heights.size(); i++) cin >> heights[i];
|
||||||
|
cin >> word;
|
||||||
|
for (auto letter : word) if (heights[letter-'a'] >= max_height) max_height = heights[letter-'a'];
|
||||||
|
cout << max_height * word.size() << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue