thriver
BAN USER
Questions (1)
Comments (3)
Reputation 40
- 0of 0 votes
AnswersYou are given an array of strings. For example, ["AB", "BC", "FOO", "ZA", "BAZ"]
- thriver in United States
- Output strings where you can get from one to the other using any ROT transformation.
ROT_1(AB) = BC
ROT_1(BC) = CD
ROT_25(AB) = ZA
AB,BC you can go from one to the other using ROT_1
Input: list of strings
Output: strings where you can get from one to the other using any ROT transformation.
Example:
Input : ["AB", "BC", "FOO", "ZA", "BAZ"]
Output: [ [ab, bc] , [ab, za] ]
AB,BC because you can go from one to the other using ROT_1
AB,ZA because you can go from one to the other using ROT_25
Do not return FOO, BAZ you can’t get from one to the other.| Report Duplicate | Flag | PURGE
Google Software Developer
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
nice! was asked the same question recently and gave similar solution!
- thriver April 16, 2022