Longest word and non-ocurring letters X25396


Statement
 

pdf   zip

Given a sequence of words, we wish to know:

  1. The longest word appearing in the sequence.

  2. All the letters that do not appear in any of its words (the first in the input sequence, when ties occur).

For solving this second item, your program must implement the function

void print_false(const vector<<bool>>& @v@);

which prints, for any position ii of vector @v@ holding value @false@, the character with ASCII code a+i'a' + i.

Input

The input is formed by a natural n>0n > 0 followed by nn non-empty words. Each word is composed exclusively by lowercase letters.

Output

Print the longest word in the input sequence (the first in the input sequence, in case of a tie), followed by the ordered list of lowercase letters that do not appear in any word of the sequence.

Observation

You may find useful to define and use the constant @LENGTH_ALPHABET@,

const int LENGTH_ALPHABET = ’z’ - ’a’ + 1;

 

Public test cases
  • Input

    5
    this is the third control
    

    Output

    control
    a
    b
    f
    g
    j
    k
    m
    p
    q
    u
    v
    w
    x
    y
    z
    
  • Input

    1
    hello
    

    Output

    hello
    a
    b
    c
    d
    f
    g
    i
    j
    k
    m
    n
    p
    q
    r
    s
    t
    u
    v
    w
    x
    y
    z
    
  • Input

    5
    all  bye one two rye
    

    Output

    all
    c
    d
    f
    g
    h
    i
    j
    k
    m
    p
    q
    s
    u
    v
    x
    z
    
  • Input

    5
    there are many programming paradigms
    

    Output

    programming
    b
    c
    f
    j
    k
    l
    q
    u
    v
    w
    x
    z
    
  • Information
    Author
    Professorat de PRO1
    Language
    English
    Translator
    Maria Serna
    Original language
    Catalan
    Other languages
    Catalan Spanish
    Official solutions
    Unknown.
    User solutions
    C++