Create, write and show (Notes App)

A notes app. new <title creates a note with the next id (created note <id: <title; no title: error: a note needs a title). write <id <text adds a line (note <id: <n lines). show <id prints == <title and its lines. delete <id prints deleted note <id. list prints <id. <title (<n lines) for each note by id, or (no notes). A missing note prints error: no note <id; anything else error: unknown command.

Input: One command per line.

Output: One result per command.

Difficulty: Easy. Write your answer in the browser editor, run the examples, then submit it against hidden tests. Python and JavaScript are free; other languages are part of licode Club.

Hint

  • Store notes in a map from id to {title, lines}.

More Notes App practice