Implementations of Problem 1 in Python, Go, and Scala