Professional Documents
Culture Documents
Alice and Bob decide to play a game. Alice says any random Number X and
bob have to say what will be its twin prime. If twin prime is not possible for the
given number than bob must say NO. Twin primes are the numbers having a
difference of 2. So help bob to win the game.
Example
Input 1:
3
Output 1:
5
Input 2
1232
Output
NO
You are a very good hacker and have recently joined RAW. Your team has
found some secret encrypted details of ISIS and has managed to find out that
how the message was encrypted.
Your task is to convert all these encrypted strings back to the integers.
Input Format:
The first line of input contains a single integer t denoting the number of test
cases.
Next t lines contain a single string each denoting the encrypted message.
(It is guaranteed that all the characters in the string will be lower case
alphabets from “a” to “j”)
Output Format:
Decrypt the string and print the integer in a new line for each test case.
Sample Input:
1
fh
eb
Output:
87
65
Explanation:
Test case 1:
f->5, h->7 ; 5->0101, 7->0111
fh -> 0101,0111
or fh -> 1010111
1010111 -> 87
Hence fh -> 87
Write a Python Script that takes a string as user input (with empty prompt) and
strips out all characters except: a-z, A-Z, 0-9, underscore and the forward
slash.
Alphabets can be Lower or Upper Case.