Almost Same Strings
You are given a list of lowercase alphabet strings words
where each string is of the same length. Return whether there’s two strings that differ only in one index.
Constraints
1 ≤ n ≤ 100,000
wheren
is the total number of characters inwords
https://binarysearch.com/problems/Almost-Same-Strings
Examples
Example 1
Input
- words =
['abcd', 'aaaa', 'abcf']
Output
- answer =
True
Explanation
We see that "abcd"
and "abcf"
only differ in the last index.
Leave a comment