Question: Simple decryption Problem Statement You come across a dump of secrets that have a very simple eneryption. Each secret is a simple string that contains

Simple decryption
Problem Statement
You come across a dump of secrets that have a very simple eneryption. Each secret is a simple string that contains combination of 10 or less than 10 unique letters from a to z1 without any spaces or special characters.
The encryption scheme is as follows:
In the final encrypted string, each unique letter appears only once, For each subsequent appearance of the letter, it is denoted by the letter's index in the list of unique letters in the string, ordered by its first appearance.
For example if the secret string is doctorstrange, the encrypted string will be doct1rs34ange
For a given encrypted string str, you need to crack the code and figure out the original unencrypted string.
Input Format
Input contains a single string str.
Constraints
1.1s= length(str)10??7-1
2. Total number of unique characters in str will be 10
Output Format
A single string which is the unencrypted version of encrypted string str. If the encrypted string is invalid, i.e. it cannot be a valid encrypted string as per the above encryption schema, the output should be "invalid code"
Sample Input:
doct1rs34ange
Sample Output:
doctorstrange
\table[[Letter,Untque Characters List,CharacteriDiglt,Unenerypted String],[d,[d],character,d],[,d,0,character,],[c,d,0,d,character,c],[t,d,0,c,t,character,t],[1,d,0,c,t,digit,-],[r,d,0,c,t,r,character,r
 Simple decryption Problem Statement You come across a dump of secrets

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!