Back to problems

Count the Number of String Pairs With No Common Characters

Algorithm · Netflix · Medium

For an array of strings named words, determine how many unique index pairs (i, j), where i < j, contain two strings with zero characters in common. Pairs are based on positions: equal string values occurring at separate indices must still be counted as separate items. The interviewer expects an approach with a target running time near O(n log n). Example Input: ["hat", "arm", "sky", "tap"] Output: 3 Explanation: the qualifying pairs are: ("hat", "sky") ("arm", "sky") ("sky",…

Checking your access…