Sum of Prefix Scores of Strings

You are given an array words of non-empty strings. Define the score of a string word as the number of strings words[i] such that word is a prefix of words[i]. Return the sum of the scores of every string in words.

Formally, for each string word in the array, count how many strings in the array start with word (a string is always a prefix of itself). The answer is the total of those counts across all strings.

Examples
Input: ["abc","ab","bc","b","c"]
Output: 7
Hints

Sum of Prefix Scores of Strings

You are given an array `words` of non-empty strings. Define the **score** of a string `word` as the number of strings `words[i]` such that `word` is a prefix of `words[i]`. Return the sum of the scores of every string in `words`.