-
Notifications
You must be signed in to change notification settings - Fork 6
/
Solution.cs
31 lines (27 loc) · 943 Bytes
/
Solution.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
var h_temp = Console.ReadLine().Split(' ');
var inputHeights = Array.ConvertAll(h_temp, Int32.Parse);
var alphabetHeight = new Dictionary<char, int>();
var alphabet = 'a';
foreach (var height in inputHeights)
{
alphabetHeight.Add(alphabet++, height);
}
var maxAlphabetHeight = 0;
string word = Console.ReadLine();
foreach (var letter in word)
{
if (alphabetHeight[letter] > maxAlphabetHeight)
{
maxAlphabetHeight = alphabetHeight[letter];
}
}
var areaOfSelectedText = maxAlphabetHeight * word.Length;
Console.WriteLine(areaOfSelectedText);
}
}