Entry for /r/dailyprogrammer challenge # 162.