摘要: 和题目leetcode221思路一样,只有第13行和14行不同。 阅读全文
posted @ 2019-12-01 12:14 Sempron2800+ 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 以 cheese为基础,假设全部都是 小的,则需要 2 * cheese 个tomato,记为 tomato_low假设全部都是 大的,则需要 4 * cheese 个tomato,记为 tomato_high 先判断提供的tomato是否在这个区间内,如果不在这个区间内,则返回[]在这个区间内。 阅读全文
posted @ 2019-12-01 12:12 Sempron2800+ 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 使用多个变量,存储行、列、对角线、反对角线等信息。 阅读全文
posted @ 2019-12-01 12:06 Sempron2800+ 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 分6种情况讨论(第一个if语句是两种情况) 阅读全文
posted @ 2019-12-01 09:34 Sempron2800+ 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def toHexspeak(self, num: str) -> str: 3 dic = {'a':'A','b':'B','c':'C','d':'D','e':'E','f':'F','1':'I','0':'O'} 4 dn_10 = int(num) 5 dn_16 = hex(dn_ 阅读全文
posted @ 2019-12-01 08:52 Sempron2800+ 阅读(151) 评论(0) 推荐(0) 编辑