Company: BNY Codedivas 2026
Difficulty: medium
Waste of Time Sid is learning combinations in his class. His teacher has assigned him a task in which a string containing the letters from 'a' to 'h' will be given to him. Each letter is mapped to a set of numbers. The mapping of digits to letters is given below:- 'a'=> [1,2], 'b'=>[3,4], 'c'=>[5,6] , 'd'=>[7,8] , 'e'=>[9,10,11], 'f'=>[12,13] , 'g'=> [14,15], 'h'=>[16]. He can create a 2D array consisting of 1D arrays having all the possible combinations of the mapped numbers of the string. Your task is to find and return the resultant sum by adding all the numbers from the possible arrays. Note: The length of the arrays should be equal to length of the input string. As the sum can be very large, return sum modulo 10 9 +7. Input Specification: input1 : A string value representing the string given to Sid by his teacher. Output Specification: Return an integer value representing the sum of all the numbers from the possible arrays. Example 1: input1 : e Output : 30