This is a cross post of @life-hacker/leetcode-challenge-python3-problem-2 by Hive account@life-hacker.LeetCode Challenge (Python3). Problem 2