Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

Find the nth character of the decrypted string.

Home > Programs > Basics

7 / 265

Every character in the input string is followed by its frequency.
Write a function to decrypt the string and find the nth character of the decrypted string. If no character exists at that positionthen then return "-1".
For eg:- If the input string is "a2b3" the decrypted string is "aabbb".
Note: The frequency of encrypted string cannot be greater than a single digit i.e.<10.


The decrypted string is "abccc", hence the 5th character in the decrypted string is "c".


Asked In :: Nagarro Wipro NLTH TCS Ninja HackerRank

Post Your Answer Here: