Digital Dictionary (is there any more efficient way)

Code link : https://ide.codingblocks.com/s/164739

4th testcase is taking over 2.5 seconds. Is it okay or a more efficient method is available.


See these times. Isn’t it taking very large time.

@vivek21,
Your approach is correct. The test cases are large that’s why large times