Scala solutions to Reddit Daily Programmer problems