OP 11 March, 2022 - 07:06 PM
You are in process of developing a new language with the help of alphabets, numbers, and special characters. You can decide your own sequence of these characters (alphabets, numbers, and special characters) while creating a new language.
Suppose you have created a language sequence as something like "lkahgfswetimncx96345@#) (" and if the user enters any string like "Philacodist 2021" then your code should generate a new word with the help your new sequence by considering the rules mentioned below:
Input
palskdjfieuryt93516247oh
Philacodist 2021
Output
palsdiitoh 122
Explanation-
On comparison of string with sequence, we find there is no character 'c' in the sequence, so we removed it from the string to be converted. Based on language sequence the characters are arranged to form a new generated word.
TIME LIMIT :- 1sec
Can use:- C/C++/Java/PHP/Python/C#
Need it ASAP please!
Suppose you have created a language sequence as something like "lkahgfswetimncx96345@#) (" and if the user enters any string like "Philacodist 2021" then your code should generate a new word with the help your new sequence by considering the rules mentioned below:
- If a character in the string is not present in your sequence, then it should eliminate the character from the new word.
- If that character is present in your sequence, then it should print as it is, but its position in the final word will be different. For e.g. in the example above, h is a part of the language sequence and so are i, l, a, c, s and t. The final new word that will be substitute of "Philacodist 2021" given the sequence "lkahgfswetimncx96345@#) (" is "lahstiic". This example should make it clear, how a matching character should be processed.
- The sequence should not have characters repeating itself. If any character is repeated in the language sequence, then output should display "New language Error".
- Alphabets are not case sensitive i.e. you can match the string with sequence in a case-insensitive manner.
- Space is not a character, so include it in the same place as that in the string that is to be translated.
Input
palskdjfieuryt93516247oh
Philacodist 2021
Output
palsdiitoh 122
Explanation-
On comparison of string with sequence, we find there is no character 'c' in the sequence, so we removed it from the string to be converted. Based on language sequence the characters are arranged to form a new generated word.
TIME LIMIT :- 1sec
Can use:- C/C++/Java/PHP/Python/C#
Need it ASAP please!