Join 60,000+ competitive exam aspirants
In a certain code language, ‘DEFAULT’ is coded as ‘DTLUAFE’ and ‘BROUGHT’ is coded as ‘BTHGUOR’. What is the code for ‘FANTASY’ in the given language?
YSATNAF
FYSATNA
SATANF
YFANTAS
FYSATNA
Observe the first letter remains constant; then, split the remaining letters into two halves and swap them: [Fixed] + [Right Half] + [Left Half].
Observe the first letter remains constant; then, split the remaining letters into two halves and swap them: [Fixed] + [Right Half] + [Left Half].
Analyze the Pattern in DEFAULT
DEFAULT has 7 letters. The first letter D is fixed. The remaining 6 letters (EFAULT) are split as (EFA) and (ULT). The code DTLUAFE keeps D fixed, then puts (ULT) then (EFA).
Verify Pattern in BROUGHT
BROUGHT has 7 letters. B is fixed. The remaining 6 (ROUGHT) are split as (ROU) and (GHT). The code BTHGUOR keeps B fixed, then puts (GHT) then (ROU).
Apply Pattern to FANTASY
FANTASY has 7 letters. Keep F fixed. The remaining 6 (ANTASY) split into (ANT) and (ASY). The code is F + (ASY) + (ANT) = FYSATNA.
A: YSATNAF incorrectly reverses the entire string. C: SATANF omits the first letter and rearranges wrongly. D: YFANTAS incorrectly shifts the first letter to the second position.
B is correct because the pattern fixes the first letter and swaps the two halves of the remaining six letters, resulting in F + ASY + ANT = FYSATNA.
In coding-decoding, always check if the first or last letters are stationary before applying complex shift-based logic.