Pin, archive and sort (Notes App)
Add pin/unpin <id (note <id pinned|unpinned) and archive/unarchive <id (note <id archived|unarchived). list now shows pinned notes first (marked ), then the rest, each group by most recently changed first (creating, writing, editing and undoing count as changes); archived notes are hidden, list archived shows only them. find uses the same order.
Input: As before.
Output: As before.
Difficulty: Medium. 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
- Keep a counter that goes up on every change and store it on the note.