Company: citi_16oct
Difficulty: medium
Strings with Common Letter at Same Position Problem Description You are given an array S of N words. All words have the same length M and use only lowercase English letters. Words are indexed 0 to N - 1 , and the letters inside a word are indexed 0 to M - 1 . Two different words match at position k when they carry the same letter at that position. For example, in S = ["abc", "bca", "dbe"] word 0 ( "abc" ) and word 2 ( "dbe" ) match at position 1 (both have b there), while words 0 and 1 match at no position at all. Find a pair of words that match at some position and report it as a triple [i, j, k] : the two word indexes i and j , and the position k where they match. If no two words match anywhere, report that there is no pair. Several triples can qualify. Report the one with i < j that is lexicographically smallest : the smallest i first, then among those the smallest j , then among those the smallest k . (inferred -- the source accepts any matching pair in either order; a single an