Mapped Strings Doubt

Hey guys this is the link to my code I am able to pass the base testcase but not able to pass all testcases please help me out with this problem.