Arrays And Hashing Leetcode Problems Python