Odd One Out Difference Pattern

Company: Hakerrank_24july

Difficulty: medium

Problem Statement

You are given a list of strings. All strings in the list have the same length, and every string consists solely of uppercase English letters. For each string, compute the difference pattern : the sequence of differences between consecutive letters, where each difference is the alphabetical position of the later letter minus that of the earlier letter (for example, 'B' - 'A' = 1 and 'C' - 'A' = 2 , so a difference may be positive, negative, or zero). In the list, all strings except exactly one share the same difference pattern. Identify and return the one string whose difference pattern is different from all the others. Input Format The first line contains a single integer n , the number of strings in the list. Each of the next n lines contains one string. Output Format Print the single string whose difference pattern is unique (different from the pattern shared by every other string). Constraints 3 <= n <= 26 2 <= length of each string &