[Question]
  [
# Background
In [Boggle](http://en.wikipedia.org/wiki/Boggle), a round is scored by adding up the points for each *unique* word a player has found (i.e. any word that more than one player has found is worth 0 points). The points are calculated based on the number of letters in each word, as follows:
3 letters: 1 point
4 letters: 1 point
5 letters: 2 points
6 letters: 3 points
7 letters: 5 points
8 or more letters: 11 points
# Challenge
In this challenge, write a program or function that takes in a list of lists of strings representing each player's words and outputs a list of the players' scores. You can assume that there will be at least 2 players and all words will be 3 or more letters and will all be lowercase (or all uppercase if you would prefer). You may also assume that each player will only use each word once; that is, no player's list will contain duplicates. This is code golf, so shortest answer in bytes wins.
# Rules
Input can be taken in any reasonable format. Examples include a list of lists of strings, a list of comma-separated strings, a comma separated string on each line of input, etc. Output can be in the form of a list of integers (or your language's equivalent) or you can print the values to stdout using a separator of your choice (such as a newline).
# Test Cases
Input => Output
```
[["cat","dog","bird","elephant"],
 ["bird","dog","coyote"],
 ["dog","mouse"]]                 => [12,3,2]
[["abc","def","ghi"],
 ["ghi","def","abc"]]             => [0,0]
[["programming","puzzles"],
 ["code","golf"],
 []]                              => [16,2,0]
```
  
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~21~~ ~~20~~ 19 bytes
-2 bytes thanks to [Zgarb](https://codegolf.stackexchange.com/users/32014/zgarb)
Idea taken from [A055228](http://oeis.org/A055228)
```
ṠṀöṁ(⌈√Π-3▼8L)fε`#Σ
```
[Try it online!](https://tio.run/##yygtzv7//@HOBQ93Nhze9nBno8ajno5HHbPOLdA1fjRtj4WPZtq5rQnK5xb///8/OlopObFESUcpJT8dSCZlFqUAqdSc1IKMxLwSpVidaJgYREFyfmV@SSpYHCKQm19aDOTHAgA "Husk – Try It Online")
### Explanation (Of older version)
```
            ṠṀ-oṠ-uΣ   Remove duplicated words
                   Σ   Concatenate
                  u    Remove duplicates
               oṠ-     Remove those unique elements from the list (give list of elements that appear more than once)
            ṠṀ-        Remove those words from each list in the input
m                      For each list
 ṁ(                    Map then sum
          L)           Length
        ▼8             Min(8,x)
      -3               Minus 3
     Π                 Factorial
    √                  Square root
   ⌈                   Ceiling
```
[Answer]
# [R](https://www.r-project.org/), ~~142~~ ~~126~~ ~~121~~ 117 bytes
```
function(L)sapply(lapply(L,setdiff,(l=unlist(L))[duplicated(l)]),function(x)sum(c(1,1,2,3,5,11)[pmin(6,nchar(x)-2)]))
```
[Try it online!](https://tio.run/##hY89T8MwEIb3/IooS23JHVIEE52QkJAysqUeHH8klhzb8geiRfz2cCZpxYDAw53v9evn7sKSZExPLMpX92J9Ts8uzCzVj/taZcuTdhZF/FHJN2aQZyFKlI5jzANqaEMa3JC1OJ16KDn6Ua@S0TGhokdcTvVZVarQlxu@w5F5b87IrKkjUSahlSLIHLP9BnQY9yJ7ozlLUiCDKSY3wDuOeYYeLWnJgdyRe9K2uPeztuiBWD6xAJb9Af7gRaFf90W7vm@ADQMLN0IcdBCQpJF@YjY1lFR1f1VXC3dnl@T2skqzyxEUWtc7WPWvXmzgBSQVxHHSG6XcrmpxAOk/kA9uDGyGZcsAPl8uRsYNx52Qhe@MWhVKAbd8AQ "R – Try It Online")
Takes `L` as a list of vectors of strings; returns the values.
First, it `unlist`s the words, finds the duplicates, then removes them from the players' word lists. Then it takes these unique word lists and computes the scores of each, using `pmin` to ensure that words longer than 8 get scored as 11.
[Answer]
# JavaScript (ES6), 92 bytes
```
a=>a.map(b=>b.reduce((s,v)=>s+(a.filter(b=>b.includes(v))[1]?0:+"11235"[v.length-3]||11),0))
```
Somewhat similar to [Rick Hitchcock's answer](https://codegolf.stackexchange.com/a/143233/69583) but created mostly independently; I used a different method of summing (`reduce`) and different method for checking for repeated terms (`filter` + `includes`). Credit to him for the idea of checking for item `[1]` instead of checking `.length>1`, though.
## Test Cases
```
let f=
a=>a.map(b=>b.reduce((s,v)=>s+(a.filter(b=>b.includes(v))[1]?0:+"11235"[v.length-3]||11),0))
;[[["cat","dog","bird","elephant"],["bird","dog","coyote"],["dog","mouse"]],[["abc","def","ghi"],["ghi","def","abc"]],[["programming","puzzles"],["code","golf"],[]]]
.forEach(test=>O.innerHTML+=JSON.stringify(test)+" -> "+JSON.stringify(f(test))+"\n")
```
```
<pre id=O></pre>
```
[Answer]
# JavaScript (ES6), ~~106~~ 93 bytes
*[Saved 13(!) bytes, thanks to Arnauld, Shaggy, and JollyJoker.]*
```
a=>a.map(b=>b.map(c=>x+=(a+'').split`,`.filter(d=>d==c)[1]?0:+'11235'[c.length-3]||11,x=0)|x)
```
**Test cases:**
```
let f=
a=>a.map(b=>b.map(c=>x+=(a+'').split`,`.filter(d=>d==c)[1]?0:+'11235'[c.length-3]||11,x=0)|x)
console.log(f([["cat","dog","bird","elephant"],
               ["bird","dog","coyote"],
               ["dog","mouse"]
              ])
           )  // [12,3,2]
           
console.log(f([["abc","def","ghi"],
               ["ghi","def","abc"]
              ])
           ) // [0,0]
           
console.log(f([["programming","puzzles"],
               ["code","golf"],
               []
              ])
            ) // [16,2,0]
```
[Answer]
# [Perl 6](https://perl6.org), 64 bytes
```
{@^a.map:{sum .map:{@a.Bag{$_}>1??0!!(1,1,2,3,5)[.comb-3]||11}}}
```
[Try it online!](https://tio.run/##NUzLDoIwEDzrVxTCoU0qsRo9aFTibxg1SymPhLpNgQMi344UwmVmZ3ZmjLLlcdAtCVJyGbroBaEGc@qqRpP5iiC8Q9YF7/4qbret51HBBd/xPT@wRyhRx5v98/cTou/7oQK3RIM3IylaQtcrSn0Jtc/9BLMR48ImI6lSmRw@tc84Xbw5ILHFWk3@bGhsqlEzPm1BLF1UpSNmeTHlHC@e@y9ZYzGzoHXxcTum@X5LVU0NiYlyA1imTrsCOw9/ "Perl 6 – Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 26 bytes
Uses [H.PWiz's formula](https://codegolf.stackexchange.com/a/143217/59487).
```
m+Fm.E@.!a3hS,8lk2fq1/sQTd
```
**[Verify all the test cases.](https://pyth.herokuapp.com/?code=m%2BFm.E%40.%21a3hS%2C8lk2fq1%2FsQTd&input=%5B%5B%22cat%22%2C%22dog%22%2C%22bird%22%2C%22elephant%22%5D%2C+%5B%22bird%22%2C%22dog%22%2C%22coyote%22%5D%2C+%5B%22dog%22%2C%22mouse%22%5D%5D%0A&test_suite=1&test_suite_input=%5B%5B%22cat%22%2C%22dog%22%2C%22bird%22%2C%22elephant%22%5D%2C+%5B%22bird%22%2C%22dog%22%2C%22coyote%22%5D%2C+%5B%22dog%22%2C%22mouse%22%5D%5D%0A%0A%5B%5B%22abc%22%2C%22def%22%2C%22ghi%22%5D%2C%5B%22ghi%22%2C%22def%22%2C%22abc%22%5D%5D%0A%0A%5B%5B%22programming%22%2C%22puzzles%22%5D%2C%5B%22code%22%2C%22golf%22%5D%2C%5B%5D%5D%0A&debug=0&input_size=2)**
The initial version, **33 bytes**:
```
m+Fm*h+++*6>lk7y>lk6>lk5glk3q1/sQ
```
**[Verify all the test cases.](https://pyth.herokuapp.com/?code=m%2BFm%2ah%2B%2B%2B%2a6%3Elk7y%3Elk6%3Elk5glk3q1%2FsQ&input=%5B%5B%22cat%22%2C%22dog%22%2C%22bird%22%2C%22elephant%22%5D%2C+%5B%22bird%22%2C%22dog%22%2C%22coyote%22%5D%2C+%5B%22dog%22%2C%22mouse%22%5D%5D%0A&test_suite=1&test_suite_input=%5B%5B%22cat%22%2C%22dog%22%2C%22bird%22%2C%22elephant%22%5D%2C+%5B%22bird%22%2C%22dog%22%2C%22coyote%22%5D%2C+%5B%22dog%22%2C%22mouse%22%5D%5D%0A%0A%5B%5B%22abc%22%2C%22def%22%2C%22ghi%22%5D%2C%5B%22ghi%22%2C%22def%22%2C%22abc%22%5D%5D%0A%0A%5B%5B%22programming%22%2C%22puzzles%22%5D%2C%5B%22code%22%2C%22golf%22%5D%2C%5B%5D%5D%0A&debug=0&input_size=2)**
# Explanation
```
m+Fm*h+++*6>lk7y>lk6>lk5>glk3q1/sQ   Full program.
m                                    Map over the input.
   m                                 Map over each sublist.
                        >lk3         Is the length higher than 2? 1 if True and 0 if False.
      +             >lk5             Plus "is length higher than 5?".
       +       y>lk6                 Plus "is length higher than 6?", doubled.
        +*6>lk7                      Plus "is length higher than 7?", times 6.
     h                               Increment.
                            q1/sQ    Count the occurrences of the element in the flattened
                                     input, and check if it equals 1. 0 if False, 1 if True.
    *                                Multiplication.
 +F                                  Sum each sublist.
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~76~~ 75 bytes
```
f l=[sum[fst.last$zip[0,0,1,1,2,3,5,11]w|w<-p,[w]==(filter(==w)=<<l)]|p<-l]
```
[Try it online!](https://tio.run/##hZLRasMgGIXvfQoJvWjBjKZju4p9EfHCJprINIoawrLu2TON9CZdNgWV438OfmrP/AdXalkEVJj4URPhw4tiPhxmackZnVEV@wW9ojdUVXS6T3VpEZkoxkchVeDuiPF0wnWtTvRu61LRRTM5QAxbA6B1cgjwAAUkpGhYKFDRmi6ON@naOHHFbc@GUFAEyUPMFY35NIHnjaxoM/ooULjJZbcmubiIY9fLbEmLh5gKom3rs850jmkth5Rux3lW3Gd3Y1qe0owSq7C6wVcJ/sUAuxzgGWTb8BWSKl32hQLwKxnYQduExIfLCXuM4AkSZMq/2nq89/gbYnj5vfwA "Haskell – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt/), ~~29~~ ~~25~~ ~~24~~ ~~23~~ ~~21~~ 20 bytes
```
Ëx@èøX ¥1©3nXÊm8)Ê¬c
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.5&code=y3hA6PhYIKUxqTNuWMptOCnKrGM=&input=W1siY2F0IiwiZG9nIiwiYmlyZCIsImVsZXBoYW50Il0sWyJiaXJkIiwiZG9nIiwiY295b3RlIl0sWyJkb2ciLCJtb3VzZSJdLFsiYWJjIiwiZGVmIiwiZ2hpIl0sWyJnaGkiLCJkZWYiLCJhYmMiXSxbInByb2dyYW1taW5nIiwicHV6emxlcyJdLFsiY29kZSIsImdvbGYiXSxbXV0=)
* Saved 4 bytes by using [the formula H.PWiz found](https://codegolf.stackexchange.com/a/143217/58974) for the scoring.
---
## Explanation
Implicit input of array `U`.
```
Ëx@
```
Map over the array (`Ë`) and reduce each sub-array by addition (`x`) after passing its elements through the following function, where `X` is the current word.
```
èøX
```
Count (`è`) the elements in `U` that contain (`ø`) `X`.
```
¥1
```
Check if that is equal to 1.
```
©
```
Logical AND (`&&`).
```
3nXÊm8)
```
Subtract (`n`) 3 from the minimum of (`m`) 8 and the length (`Ê`) of `X`.
```
Ê¬c
```
Factorial, square root and round up, respectively.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~106~~ ~~105~~ ~~88~~ 84 bytes
-1 byte thanks to Jonathan Frech  
-1 (17) bytes thanks to reffu  
```
lambda x:[sum(sum([1,0,1,1,2,6][:len(s)-2])*(`x`.count(`s`)<2)for s in l)for l in x]
```
[Try it online!](https://tio.run/##TU/RasQgEHzPV0ietNjSy0MfQu9LrBBjNBGMK2ogdz@fupcG6uLu7DgOTHyUBUJ32PvP4dU6TorsvcjbSvGKG//kt1od/5Ki9ybQzN47yd7osA8fGrZQ6JAH9t0xC4lk4gLxL@gR7vIoJpdM7kQ0pB4hWq1Ky9sJ5tpHl6Y6jDdxUaG0khNxkadCwwOKqQ/ij1hhy3WX/PJTo0a1sbXPizs9EFwkCv7pY4I5qXV1Ae3i9nx6k89fGiaDLuDti5CykU2DaTAFBjrT9CQmV5Nbijtjxy8 "Python 2 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 26 bytes
```
ðċ@Ị¥ÐfL€«8ị“¡[żÇ’ḃ11¤Sµ€Ẏ
```
[Try it online!](https://tio.run/##y0rNyan8///whiPdDg93dx1aenhCms@jpjWHVls83N39qGHOoYXRR/ccbn/UMPPhjmZDw0NLgg9tBco/3NX3////6Gil5MQSJR2llPx0IJmUWZQCpFJzUgsyEvNKlGJ1uBSiYaIQJcn5lfklqVAZiFBufmkxUCQWAA "Jelly – Try It Online")
[Answer]
# R, 117 bytes
A completely different approach from the [other R answer](https://codegolf.stackexchange.com/a/143214/6741):
```
function(L)sapply(L,function(x)sum(c(0:3,5,11)[cut(nchar(x[x%in%names(which(table(unlist(L))<2))]),c(0,2,4:7,Inf))]))
```
Test cases:
```
> f=function(L)sapply(L,function(x)sum(c(0:3,5,11)[cut(nchar(x[x%in%names(which(table(unlist(L))<2))]),c(0,2,4:7,Inf))]))
> L=list(c("cat","dog","bird","elephant"),c("bird","dog","coyote"),c("dog","mouse"))
> f(L)
[1] 12  3  2
> L=list(c("abc","def","ghi"),c("ghi","def","abc"))
> f(L)
[1] 0 0
> L=list(c("programming","puzzles"),c("code","golf"),c())
> f(L)
[1] 16  2  0
```
Takes the names occurring only once in the list, convert their length to a factor based on the given cut-off points and translates that into scores that is then summed.
[Answer]
# Java 10, ~~202~~ ~~200~~ ~~198~~ ~~197~~ 194 bytes
```
a->{int q=a.length,r[]=new int[q],i=0,j,f;for(;i<q;i++)for(var s:a[i]){for(f=j=0;j<q;)f|=a[j].contains(s)&!a[i].equals(a[j++])?1:0;r[i]+=f<1?(j=s.length())<5?1:j<6?2:j<7?3:j<8?5:11:0;}return r;}
```
-1 byte thanks to *@ceilingcat*.
**Explanation:**
[Try it here.](https://tio.run/##zVI9b9swEN39K9gMAQkpgt0ibWCJEbK3WTIKGs4UJVOlSJmkXDiqfrtLWVFgBO0QL81yuI93j/ceWMMeburi55FJsBb9AKH6BUJCOW5KYBw9juWpkeWI4drjo84JGT0YA4fvwrrkyRmhqns/BxJ79LDwwTpwgqFHpOgRbu57T4B2FCLJVeW2oclyqvivE@8uDwVdhnVYxqU2OBbJLhZBQMZiDwbZNWQiJ/1Yl7Smy7j2CFL@ppDVecS0cv5siy25/jQiI77rQFrsp0GQk3S1XsbG9wNaJqsU19S@XIEJSW79uE6@pp99/JZ@8fEuvV2vxp3BcNcZhUw8HONRU9ttpNf0Im2vRYEa/zKeDMhyIJNZTwfreBPpzkWtnzip3vpmI6enLawihkcn/uJslk98CP0DMFuPSd9DUeArBu6KxKe00NWcboQp5pxL3m5BjbBhCN9Jf050xs/0QTt@EeMZS6M7O5EMhJw@0v90EjbsVSkv57TaiotkTntv2aY3Pobe1ujKQNP45nxe2z0/S24vEsx0wV9N07J8H8lsyLAYjn8A)
```
a->{                       // Method with ArrayList<String>[] parameter & int[] return-type
  int q=a.length,          //  Length of the input-array
      r[]=new int[q],      //  Result integer-array the size of the input-array,
                           //  initially filled with 0s by default
      i=0,j,               //  Index integers
      f;                   //  Flag integer (used as boolean)
  for(;i<q;i++)            //  Loop `i` in the range [0, `q`):
    for(var s:a[i]){       //   Inner loop over the Strings of the `i`'th List
      for(f=j=0;           //    Reset the flag `f` and index `j` both to 0
          j<q;)            //    Inner loop `j` in the range [0, `q`) again:
        f|=a[j].contains(s)//     If the `j`'th list contains the current String
           &!a[i].equals(a[j++])?
                           //     and the `i`'th and `j`'th list aren't the same:
            1              //      Bitwise-OR the flag with 1 (0->1; 1->1)
           :               //     Else:
            0;             //      Bitwise-OR the flag with 0 (0->0; 1->1)
                           //    End of inner loop (3) (implicit / single-line body)
      r[i]+=               //    Increase the `i`'th item in the result integer-array by:
            f<1?           //     If the flag is still 0 (so the current String is unique):
             (j=s.length())<5?
                           //      If the length of the String is below 5:
              1            //       Increase by 1
             :j<6?         //      Else-if the length is 5 instead:
              2            //       Increase by 2
             :j<7?         //      Else-if the length is 6 instead:
              3            //       Increase by 3
             :j<8?         //      Else-if the length is 7 instead:
              5            //       Increase by 5
             :             //      Else (the length is above 7):
              11           //       Increase by 11
            :              //     Else (the flag is 1 - thus the String is not unique):
             0;            //      Leave it the same by increasing with 0
  return r;}               //  Return the resulting integer-array
```
[Answer]
# [K (ngn/k)](https://git.sr.ht/%7Engn/k), 34 bytes
```
{+/'(&7\5782020)'#''x^\:&1<#'=,/x}
```
[Try it online!](https://ngn.bitbucket.io/k#eJxtj2FLwzAQhr/nV5QMlgQP2kV0sjnxf3QVujbtCu1Sug7mxP9u7s6qzOVDknvvzZvnqtXHXaz0fLl9WD7ZxCZGzZQ6v21X88XzTG0gPn8KUUWvSmsti3yUa1n6Ouy7ZijD4VrX7/PDKM1aTxobCv/uR0c6C50/HUMdBC3zXYFGV4W93jfkwnPSsM/OfvD1kHddc8CM/nS5tO5I/sKXDp/7tsLaGCNELNKUMIE+BUaCX8wMRJROKlu+QbnDEqNmWXS9Ni9RurBwDzYT+BVyAjED8XMI3iYVHVdBGJJAwgl/54Of+TiHJgSekJQbRP/xHsGG8C9BmHrI)
* `&1<#'=,/x` get non-unique words (i.e. words that more than one player identified)
* `x^\:` remove the non-unique words from each player's submission
* `#''` get the number of characters in each players' words
* `(&7\5782020)` a compressed version of `0 3 5 6 7 7 8 8 8 8 8 8`
* `(...)'` do a binary search, returning the index of the first value in the left-side list not larger than each item in the right-side list (this translates word lengths to their scores)
* `+/'` get each player's point total (by summing the score of their individual words)
[Answer]
# [Perl 5](https://www.perl.org/), 104 + 2 (-na) = 106 bytes
```
push@a,[@F];map$k{$_}++,@F}{map{$s=0;map$s+=(($l=y///c)<8?$l<7?$l<5?1:$l-3:5:11)*($k{$_}<2),@$_;say$s}@a
```
[Try it online!](https://tio.run/##JYxNDoIwGET3nILFtwABoZpGw0/oip0nMIbU0gix0IaWBSFc3Sq4mcx7k4zio8DWqkm3hIZ3Uj2ynip4L1CvQRCSal1@vIAukn3QQeF5IIo5jmPm59cSRH7ZApcoBRGdU5wi5B@8/0V@8kMCdabpDHol1FpGjdvIl/vsxsblgquWDsbZadNMztJwZ6u9nDT/SGU6OWgb3fAxQYmNBvoF "Perl 5 – Try It Online")
[Answer]
## Clojure, 102 bytes
```
#(for[p %](apply +(for[w p](if(next(filter #{w}(flatten %)))0(get{3 1 4 1 5 2 6 3 7 5}(count w)11)))))
```
`next` returns `nil` if there is only one word `w` :)
[Answer]
# [PHP](https://php.net/), 226 bytes
```
function x($a){foreach($a as$p){$q=call_user_func_array('array_diff',$a);array_push($a,array_shift($a));$x=0;array_map(function($b)use(&$x){$b=strlen($b);$x+=($b<5?1:($b==5?2:($b==6?3:($b==7?5:11))));},$q);$o[]=$x;}return $o;}
```
I think this could still be trimmed down quite a bit.
Ungolfed:
```
function x($a) {
    foreach ($a as $p) {
        $q = call_user_func_array('array_diff', $a);
        array_push($a, array_shift($a));
        $x = 0;
        array_map(function($b) use (&$x){
            $b = strlen($b);
            $x += ($b < 5 ? 1 : ($b == 5 ? 2 : ($b == 6 ? 3 : ($b == 7 ? 5 : 11))));
        }, $q);
        $o[] = $x;
    }
    return $o;
}
```
[Try it online!](https://tio.run/##TVHbboQgEH33K4ghXUx96LbZNlmX@CHGGFRQExUWsHHX@O12kDUpDzNnhnPOcFGt2m6pahXaxDRWtpMjmglm0SKk5qxqASNmsIoWfKcV6/tiMlwXjlwwrdmDnPZU1J0QpxiUia/VZJw49pVpO2Gdb5TgmX68OANT5BhLcBmBNXnDM8wqqbG653sXFO8UwO2Snq@QKb2knx58p18e/KSX6/kcwUrWGN9BI7Oc4jlZNbeTHhGWybphy401iKIsQLCyLKyYDeOwlg3EstM1JN5z1bLRhnmMsqPpGZV8SMv9hu8MEs4c5nl8GLKycnQuIDZt57kOHE1H@MdXWjaaDUM3Ojs1PZ89N6CCo8maOxPZi93FifIkCF4fg8jrNsygHUVo2U1/mS7qaVBk9gx4kmDd/gA "PHP – Try It Online")
[Answer]
# [Scala](http://www.scala-lang.org/), 242 bytes
The function takes, as a parameter `a`, a `Seq[Set[String]]` and returns an `Array[Int]`. I use an Array for it to be mutable (4-char loss).
```
var s=Seq("")
a.foreach(x=>x.foreach(y=>s:+=y))
var u:Array[Int]=Array()
var i= -1
a.foreach(t=>{i+=1
u:+=0
t.map(x=>{val l=x.length
if(s.count(_==x)<2){if(l>7)u(i)+=11
if(l==7)u(i)+=5
if(l==6)u(i)+=3
if(l==5)u(i)+=2
if(l>2&l<5)u(i)+=1}})})
u
```
[Try it online!](https://tio.run/##nZJBa4MwFMfv@RTiYSS0k9nRDUoj9LjDTj2WMmJ8akZMnMZOK352F6uOdqfRS8j/l5ffI4@UnEnW6/ATuHHemVAO1AZUVDq7PG8RiiB2Qp0kEjDb7OHrsAdz2JtCqOR4JJtdUbDm8KbMkbb9iRVOSW0Rdl2CmBfrAhhPcU2D@jc0NCg3C9oQgob66lpx2eLxQFDn0b@SGBq0YkF9VNnbT8h4GcsHc3ti0pG09iSoxKRIxLj0uK6UwR@U1mS7Iq1lMnglFRbEGvyhRlI6g/WUX6b8POX1lFeXHKwe5HZGfteRjqCq7xCapjM8284GuylIqd2l@50y45LlDQMJecqU5YTMD8jtLA2uF65jKbokqewQ/nq51S3dSCd2DUUR3ejGNhMea7hutIH5aGSZrkq4pzkL@SCG2K5JKmbrsJ3xUHKHOS90UrAssx/KSvLqfJZQzn6uIxg6ahlP6B8dUNf/AA "Scala – Try It Online")
Might be optimizable, since I did not even work on the
```
if(l>7)u(i)+=11
if(l==7)u(i)+=5
if(l==6)u(i)+=3
if(l==5)u(i)+=2
if(l>2&l<5)u(i)+=1
```
part. Thanks for this challenge!
[Answer]
# [Swift 4](http://swift.sandbox.bluemix.net/#/repl/59c312cf603243789807753b), 164 bytes\*
```
{$0.map{Set($0).subtracting(Dictionary(grouping:$0.flatMap{$0},by:{$0}).flatMap{$1.count != 1 ?$0:nil}).map{[0,1,1,2,3,5,11][min(max($0.count-2,0),6)]}.reduce(0,+)}}
```
The above expression is technically correct, pure Swift. However, the expression is so complex that, due to exponential blowup in the type inference system, can't be processed before the compiler gives up after some arbitrary timeout (like 15s or something).
To make this expression compilable with the current compiler, it can be broken down like this:
```
{
let n = Dictionary(grouping:$0.flatMap{$0},by:{$0}).flatMap{$1.count != 1 ?$0:nil}
return $0.map{Set($0).subtracting(n).map{[0,1,1,2,3,5,11][min(max($0.count-2,0),6)]}.reduce(0,+)}
}
```
[Test cases:](http://swift.sandbox.bluemix.net/#/repl/59c312cf603243789807753b)
```
let f: (_ input: [[String]]) -> [Int] = {
    let n = Dictionary(grouping:$0.flatMap{$0},by:{$0}).flatMap{$1.count != 1 ?$0:nil}
    return $0.map{Set($0).subtracting(n).map{[0,1,1,2,3,5,11][min(max($0.count-2,0),6)]}.reduce(0,+)}
}
let testcases: [(input: [[String]], expected: [Int])] = [
    (input: [
            ["cat","dog","bird","elephant"],
            ["bird","dog","coyote"],
            ["dog","mouse"]
        ],
        expected: [12,3,2]
    ),
    (input: [
            ["abc","def","ghi"],
            ["ghi","def","abc"]
        ],
        expected: [0,0]
    ),
    (input: [
            ["programming","puzzles"],
            ["code","golf"],
            []
        ],
        expected: [16,2,0]
    ),
]
for (caseNumber, testcase) in testcases.enumerated() {
    let actual = f(testcase.input)
    assert(actual == testcase.expected,
        "Testcase #\(caseNumber) \(testcase.input) failed. Got \(actual), but expected \(testcase.expected)!")
    print("Testcase #\(caseNumber) passed!")
}
```
Broken down:
```
let verboseF: (_ input: [[String]]) -> [Int] = { playerHands in
    let allWords = playerHands.flatMap{$0}
    // demo data for first test case:
    // allWords: ["cat", "dog", "bird", "elephant", "bird", "dog", "coyote" "dog", "mouse"]
    let allWordsGroupedByThemselves = Dictionary(grouping: allWords, by: {$0})
    /* allWordsGroupedByThemselves:
    [
        "cat": ["cat"],
        "dog": ["dog", "dog", "dog"],
        "bird": ["bird", "bird"],
        "elephant": ["elephant"],
        "coyote": ["coyote"], "mouse": ["mouse"]
    ]*/
    let allWordsUsedMoreThanOnce = allWordsGroupedByThemselves.flatMap{$1.count != 1 ?$0:nil}
    // allWordsUsedMoreThanOnce: ["dog", "bird"]
    
    return playerHands.map{ hand in
        // demo data for first hand of first test case:
        // hand: ["cat","dog","bird","elephant"]
        let uniqueWordsInHand = Set(hand)
        // uniqueWordsInHand: ["cat","dog","bird","elephant"]
        let uniqueWordsInHandNotUsedByOthers = uniqueWordsInHand.subtracting(allWordsUsedMoreThanOnce)
        // uniqueWordsInHandNotUsedByOthers: ["cat", "elephant"]
        let wordLengths = uniqueWordsInHandNotUsedByOthers.map{$0.count}
        // wordLengths: [3, 8]
        let scores = wordLengths.map{ wordLength in
            return [0,1,1,2,3,5,11][min(max(wordLength-2, 0), 6)] //A look up table that maps word length to word score
        }
        //scores: [1, 11]
        let playerScore = scores.reduce(0,+)
        // playerScore: 12
        
        return playerScore
    }
}
```
[Answer]
# [ASP](https://en.wikipedia.org/wiki/Answer_set_programming) + [Python](https://docs.python.org/3/), 137 bytes
```
u(P,W):-1{p(_,W)}1;p(P,W).s(P,S):-S=#sum{@v(W):u(P,W)};p(P,_).#script(python)
def v(w):return[1,1,2,3,5,11][min(len(w.string),8)-3]#end.
```
Expects data formatted as:
```
p(1,("cat";"dog";"bird";"elephant")).
p(2,("bird";"dog";"coyote")).
p(3,("dog";"mouse")).
```
Needs [clingo](https://potassco.org/) 5.2.1 with python support.
Ungolfed:
```
unique(P,W):- 1 { player(_,W) } 1 ; player(P,W).
score(P,S):- S = #sum{@value(W): unique(P,W)} ; player(P,_).
#script (python)
def value(word):
    return [1,1,2,3,5,11][min(len(word.string),8)-3]
#end.
```
The python function is heavily inspired from [the python answer](https://codegolf.stackexchange.com/a/143218).
]