in Technology

Encode Decode

This is a simple decoding puzzle. And will set you for some more interesting ones in the future. The test you can have for yourself, is how *fast* can you solve this.

The encoding / decoding has to work only for digits. 0 (zero) to 9 (nine). The first input will be a string of 10 characters. This encoding key will define what the mapping with 0-9. The next will be a mathematical operation that you have to carry out. The equation will be in encoded format, you have to decode and provide the answer.

Consider the example:

Input 1:
2345678901

Input 2:
12 + 23

Answer:
91 (90 + 01)

See if your code can work even with characters and symbols as the encoding key!

Write a Comment

Comment