Decoding the encrypted data,sounds so interesting.One such way to decode is as follows:

Consider a 2-D array of numbers

1 2 3 4                  ———->

8 7 6 5            :    <———-

9 10 11 12         ———–>

 

equating each number to corresponding character of English alphabets(considering only lowercase alphabets) we have

abcdefghijkl

as decoded message.

Now consider an encrypted 2-D array,with each element k having integral value.Alternately, we traverse from left to right and right to left in order to traverse the 2-D array row wise. For each test case we have different input sets which includes dimension of 2-D array as mxn,

the elements of 2-D array .

and output which includes decoded letters of lowercase alphabets.

Constraints:

1<=k<=26

1<=m,n<=10

0<t<10

Sample Input:

1

3 4

1 2 3 4

8 7 6 5

9 10 11 12

Sample Output:

abcdefghijkl

Leave a Reply