Solutions are in Scala 3.
Find other solutions written in Scala here
Written in 2023-2025 by Philippus Baalman
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this template to the public domain worldwide. This template is distributed without any warranty. See http://creativecommons.org/publicdomain/zero/1.0/ or the LICENSE file.