1.Tom is a Geek, he has a following string Initial which consists of the following letters
in the mentioned order: "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ".
2.Tom also has various lists of strings, and now he wants to compute the Hash value of each list of strings.
So, the Hash is the summation of all the character values in the input:
(currentIndex + (position of the character In the string initial) ).
And then this hash is multiplied by the Number of strings in the list.
3.Let's assume that the list of strings is: ["aA1", "b"]. So, his answer would be:
a: 0 + 0 = 0.
A: 1 + 36 = 37.
1: 2 + 26 = 28.
b: 0 + 1 = 1
So, 2 * (0 + 1 + 37 + 28) = 2 * (66) = 132.
4.Your task is to complete the function getHashValue() in which a single single string is passed as
a parameter which contains all strings separated by spaces.
5.You have to return the hash value of the list of strings.
Input Format
1.Single line containing all the string separated by spaces.
Output Format
1.Return the hashvalue of the list of strings.
Constraints
1 = Length of a string = 30 1 = Number of strings in a list = 20
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
aA1 b
Output
132