Practice Odd String Difference
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given an array of equal-length strings words. 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. All the strings in words have the same difference integer array, except one. You should find that string. Return the string in words that has different difference integer array.
Source: Odd String Difference on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
words = ["adc","wzy","abc"]
"abc"
# Example 2
words = ["aaa","bob","ccc","ddd"]
"bob"
Constraints
Related LeetCode Problems
Practice more problems similar to Odd String Difference.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.