摘要: Actually, this problem could use greedy algorithm instead of dynamic programming and greedy algorithm is much faster. The basic idea is sort the coins 阅读全文
posted @ 2017-08-16 15:01 tekkaman_blade 阅读(149) 评论(0) 推荐(0)
摘要: A very very old question. I have completed this question with iteration method. This time I used recursive method. It is interesting that when I submi 阅读全文
posted @ 2017-06-09 04:56 tekkaman_blade 阅读(176) 评论(0) 推荐(0)
摘要: This is an easy question. No matter what kind of method you chose, the time complexity is at least O(m*n), becasue you have to traverse each element a 阅读全文
posted @ 2017-06-03 05:23 tekkaman_blade 阅读(158) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/k-diff-pairs-in-an-array/#/description This is a very simple question. With two-pointer method, the time complexity is O 阅读全文
posted @ 2017-05-31 03:44 tekkaman_blade 阅读(169) 评论(0) 推荐(0)