A text analyzer

The problem

Build a program that reads lines of text and reports the number of lines, words and characters, the most common words and the longest word.

Requirements

Technologies

Step by step

  1. Read all the lines into an array first and print the line count.
  2. Write a function that turns a line into clean lower case words.
  3. Count the words with the ?? 0 pattern and sort the counts.
  4. Print the top words and the longest word with printf.

Expected result

A tool that prints a clear text report for any input text.

How it is evaluated

Ways to improve it