How can I solve this problem in Python, I found some C# and Java code here: https://sites.google.com/site/tranquangtanqt1990/learn-code/codefights/arcade/2-the-cor