refactor: Add contracts, use pattern matching
refactor: Add contracts, use pattern matching

Bugfry/exercism,Bugfry/exercises,Bugfry/exercism,Bugfry/exercism,Bugfry/exercism,Bugfry/exercises,Bugfry/exercises,Bugfry/exercises,Bugfry/exercises,Bugfry/exercises,Bugfry/exercism,Bugfry/exercism