Arrays And Hashing Leetcode Python