Print the cost of making the given string a Panagram, if the gain is more than the cost then print 0.
Input: arr[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
str = "geeksforgeeks"
Output: 32
Occurrences of the characters are as follow:
g = 2, e = 4, k = 2, s = 2, f = 1, o = 1 and r = 1
The remaining 19 characters from the English alphabets will be added at cost 2 for each i.e. 2 * 19 = 38
And, 1, 3, 1 and 1 occurrences of the characters 'g', 'e', 'k' and 's' respectively can be traded for gain (1 + 3 + 1 + 1) i.e. 6
So, the normalized cost is 38 - 6 = 32
Input: arr[] = {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},
str = "thequickbrownfoxjumpsoverthelazydog"
Output: 0
The given string is already a Panagram