Count Unique Words

Write a function that given a text as a list of sentences (sublists, see
below), counts for each sentence, the number of unique words that
contain the last letter of the last word of the sentence. For example, a
text could be:

    [["Or", "if", "it", "do", "not", "from", "those", "lips", "of", "thine"], 
    ["Even", "so", "being", "full", "of", "your", "neer-cloying", "sweetness"], 
    ["Growing", "a", "bath", "and", "healthful", "remedy"], 
    ["Each", "changing", "place", "with", "that", "which", "goes", "before"]]

The output should be a list with a pair (letter, number) for each
sentence, containing the lowercase form of the last letter of the last
word of the sentence, and the number of unique words in the sentence
that contain that letter.

A few considerations:

- The text is a list of sentences, which might be empty.

- As per usual, each sublist of the list is a sentence.

- The sentences will not be empty, neither the words will be empty
  strings.

- Uppercase and lowercase versions of the letters should be considered
  the same letter.

Problem information

Author: Ferriol Calvet

Generation: 2026-01-25T16:41:45.293Z

© Jutge.org, 2006–2026.
https://jutge.org
