Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago