Back
Close
  • 126

Learning Opportunities

This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.

Statement

 Goal

In a lot of clash of code problems, you need to replace text from one form to the other. To figure it out quickly, you have decided to write a program to look at two lines and extract the replacement sequences (if any) that will convert Line X into Line Y. Hurry!
Input
Line 1: Text X.
Line 2: Text Y, with the same length as text X.
Output
If not possible: One line: CAN'T
If X and Y are equal: One line: NONE
Otherwise, each line (in the order they appear in X): FROM -> TO
Constraints
0 < Length of X, Y < 100
Example
Input
BARTENDER
CARBENDER
Output
B->C
T->B

A higher resolution is required to access the IDE