Digital Dictionary

code: https://ide.codingblocks.com/s/167801
what is wrong in my code? please help !!

Hello @shashakchandel,

If you observe the output carefully,

  1. The approach you have applied is correct.
    But, their is a logical error due to which the last character of the search string has printed twice.

  2. You have used unordered_map.
    But, the order in the dictionary is very important.

I have modified your code:

Hope, this would help.
Give a like if you are satisfied.

Hope, this would help.
Give a like if you are satisfied.

1 Like