摘要: https://leetcode.com/problems/target-sum/#/description 补充一个python的实现: 这道题的主要思想是利用字典存储之前的已经计算过的值,但是做题的时候状态不太好,所以写了很久。 做算法题,头脑不清醒的时候,效率很低,应该休息,把状态调整好再做。 阅读全文
posted @ 2017-05-13 18:55 Sempron2800+ 阅读(182) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public string IntToRoman(int num) { string[] M = { "", "M", "MM", "MMM" }; string[] C = { "", "C", "CC", "CCC", "CD", "D", "DC 阅读全文
posted @ 2017-05-13 13:57 Sempron2800+ 阅读(153) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/#/description 补充一个多次使用二分查找的解决方案: 阅读全文
posted @ 2017-05-13 11:42 Sempron2800+ 阅读(215) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/binary-tree-preorder-traversal/#/description 阅读全文
posted @ 2017-05-13 11:36 Sempron2800+ 阅读(125) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/is-subsequence/#/description 阅读全文
posted @ 2017-05-13 11:32 Sempron2800+ 阅读(102) 评论(0) 推荐(0) 编辑