Back
Close

Decryption

Statement

 Goal

You are given a key n and encrypted strings of length 2.

1st part of the string will be the encrypted character
2nd part will be count of the consecutive encrypted character

Your task is to decrypt the character using the keys and convert them into the word.

How is it encrypted?
Let string = 'MMM', n=1

step 1: count of 'M' being consecutive is 3
step 2: Add n to ascii value of 'M' and convert it into a character. Here it would come out as 'N'
step 3: Convert the sum of [count]] into character ('A' for 1, 'B' for 2, ...., 'Z' for 26) and append it to the above step. Here the count is 3 therefore append C. Hence output= 'NC'

This is how "MM" is encrypted into "NC"

You are given n and output and you need to find its corresponding string.
Input
Line 1: n to decrypt the character
Line 2 : Space separated strings giving the encrypted character and consecutive count
Output
A single line containing the word
Constraints
0<n<11
Example
Input
1
IA FA MB PA
Output
HELLO

Game modes
Fastest, Shortest, Reverse

Test cases
Test 1 Test
Input
1 IA FA MB PA
Output
HELLO

Validator 1 Validator
Input
1 HA SA FB UA
Output
GREET

Test 2 Test
Input
2 DA QB MA
Output
BOOK

Validator 2 Validator
Input
10 VA YA VB SA ZA YA ZA
Output
LOLLIPOP

Is this a word? Test
Input
3 FA UA RA VC HA FA WA LA RA QA
Output
CROSSSECTION

Validator 3 Validator
Input
5 MA JA QB TC
Output
HELLOOO

Out of bounds Test
Input
10 ]A SA dB VA OA \A
Output
SIZZLER

Validator 4 Validator
Input
9 PA UA RA ]B NA [A
Output
GLITTER

Max Count Test
Input
3 DZ
Output
AAAAAAAAAAAAAAAAAAAAAAAAAA

Validator 5 Validator
Input
10 ^Z ZZ
Output
TTTTTTTTTTTTTTTTTTTTTTTTTTPPPPPPPPPPPPPPPPPPPPPPPPPP

Solution language

Solution

Stub generator input