Count Pairs of Strings with No Common Characters

Given an array words of n strings, count the number of index pairs (i, j) such that:

  • 0 <= i < j < n
  • words[i] and words[j] share no character.

Every string contains only lowercase Eng...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: