Question: JavaScript Related questions. Given: a=1 b=2 c=3 d=4 e=5 f=6 ... z=26, And abc -> 1 + 2 + 3 = 6 bdc -> 2

JavaScript Related questions.

Given:

a=1 b=2 c=3 d=4 e=5 f=6 ... z=26,

And

abc -> 1 + 2 + 3 = 6

bdc -> 2 + 4 + 3 = 9

fc -> 6 + 3 = 9

For input: "abc cde adb dfb def ee abcd cc"

Output will be:

{

"6": ["abc", "cc"],

"12": ["cde", "dfb"],

"7": ["adb"],

"15": ["adb", "def"],

"10": ["ee", "abcd"]

}

Write a function to do so and explain the code in details.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!