摘要: Maximum Product of Word Lengths class Solution(object): def maxProduct(self, words): """ :type words: List[str] :rtype: int """ es = [] for w in words 阅读全文
posted @ 2016-06-20 04:24 absolute100 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Bulls and Cows 要点:类似于Word Pattern,guess和secret要存成两个counts,因为guess中了的可能在secret之前出现,vice versa。另一种方法是可以多遍统计:先过一遍secret,然后过一遍guess统计cows,最后统计bulls调整cows 阅读全文
posted @ 2016-06-20 04:22 absolute100 阅读(112) 评论(0) 推荐(0) 编辑