problem014.py : Refactoring