Under construction

Still being built. Things may change

Vertical Histogram

Interview

Time limit1sMemory limit1024 MB

Summary
Count how many times each capital letter appears in four input lines and print a vertical asterisk histogram with the alphabet below.
Level

Easy2 of 10

Topics
Array, Implementation, String
Solved
No attempts yet

Problem

Write a program to read four lines of upper case (all capital letters) text from the input file and print a vertical histogram showing how many times each letter appears in the input. Blanks, digits, and punctuation are not counted. Format your output exactly as shown.

Input

Lines 1 to 4: Four lines of upper case text, no more than 72 characters per line.

Output

Several lines with asterisks and spaces, followed by one line with the upper-case alphabet separated by spaces. Do not print unneeded blanks at the end of any line. Do not print any leading blank lines.

Examples1

  1. Example 1

    Input
    THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG.
    THIS IS AN EXAMPLE TO TEST FOR YOUR
    HISTOGRAM PROGRAM.
    HELLO!
    
    Expected output
                                *
                                *
            *                   *
            *                   *     *   *
            *                   *     *   *
    *       *     *             *     *   *
    *       *     * *     * *   *     * * *
    *       *   * * *     * *   * *   * * * *
    *     * * * * * *     * * * * *   * * * *     * *
    * * * * * * * * * * * * * * * * * * * * * * * * * *
    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z