Input:
rhdt:246, ghftd:1246
Output:
trhd, ftdgh
Explanation:
Here, every string (rhdt : 1246) is associated with a
number, separated by semicolon, if sum of square of digit is even the rotate
the string right by 1 position. If square of digit is odd the rotate the string
left by 2 position.
For first case:
2*2+4*4+6*6=84 which is even so rotate string, rotate right
by 1 so ”rhdt” will be “trhd”
For second case:
1*1+2*2+4*4+6*6=85 which is odd so rotate string left by 2
so “ghftd” will be “ftdgh”