Renumbered Scala solutions.