Odd String Difference Problem
Odd String Difference Problem — ExecCode Easy DSA Practice
Solve the Odd String Difference problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given an array of equal-length strings words. Your task is to you should find that string. Assume that the length of each string is n. Each string words[i] can be converted into a difference integer array difference[i] of length n - 1 where difference[i][j] = words[i][j+1] - words[i][j] where 0 <= j <= n - 2. Note that the difference between two letters is the difference between their positions in the alphabet i.e. the position of 'a' is 0, 'b' is 1, and 'z' is 25. Return the required answer exactly as shown in the examples.
Examples
Input {"words": ["adc", "wzy", "abc"]}; Output abc. Input {"words": ["aaa", "bob", "ccc", "ddd"]}; Output bob
Constraints
3 <= words.length <= 100 n == words[i].length 2 <= n <= 20 words[i] consists of lowercase English letters.
Practice Odd String Difference free on ExecCode. Browse DSA problems, topic map, and placement guides.