=== URL Shortener (simulation) === day 1
>
https://kh.link/4c4WUp  ->  https://example.com/courses/java?level=beginner
>
https://kh.link/4c4WUp  ->  https://example.com/courses/java?level=beginner
>
https://kh.link/8o9TOO  ->  http://docs.example.org/api/Stream.html  (expires after day 6)
>
Error: only http and https URLs can be shortened
>
Error: the URL needs a valid host
>
Error: only http and https URLs can be shortened
>
https://kh.link/java-course  ->  https://example.com/courses/java
>
Error: alias 'java-course' is taken
>
Error: aliases are 3-20 letters, digits or hyphens
>
302 redirect to https://example.com/courses/java (click 1)
>
302 redirect to https://example.com/courses/java (click 2)
>
302 redirect to https://example.com/courses/java (click 3)
>
404 not found or expired: zzzzzz
>
It is now day 7
>
404 not found or expired: 8o9TOO
>
java-course: https://example.com/courses/java, created day 1, 3 click(s), never expires
>
  java-course    3  https://example.com/courses/java
  4c4WUp         0  https://example.com/courses/java?level=beginner
>
Removed 1 expired link(s); 2 remain
>
Error: time only moves forward
>
