python and scala solution for problem 13