Any suggestion solving this problem
Anonymous User
167

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"]

}

Comments (1)