Company: IDFC
Difficulty: easy
Alphabet Wheel Rearrangement You are given a string str1 whose characters have to be rearranged according to a specific pattern. In the original assessment the pattern itself was withheld and only worked examples were shown, so your first job is to read the pattern off the examples below. Some examples following the pattern are given here: INPUT OUTPUT HELLO JGNNQ WORLD YQTNF OPEN QRGP CLOSE ENQUG ZERO BGTQ AA CC So that the contract is exact enough to be judged, the pattern those examples encode is spelled out here (inferred — the source deliberately hides the rule and shows only the six pairs above; the pairs determine the rule uniquely, and a hidden test suite cannot be graded against a rule the solver has to guess, so it is pinned explicitly) : Write the 26 uppercase English letters A B C … Z around a wheel, so that Z is immediately followed by A again. Every character of str1 is replaced, independently of its position, by the letter that stands two places further along the wheel .