Cryptarithmetic Problems Leetcode Python