上一页 1 ··· 16 17 18 19 20
摘要: Well, the basic idea is fairly straightforward. We maintain a mappingmpfrom a value innumsto its position (index)i. Each time we meet an unseen value,... 阅读全文
posted @ 2015-06-02 23:18 jianchao-li 阅读(155) 评论(0) 推荐(0) 编辑
摘要: This problem is a little tricky at first glance. However, if you have finished theHouse Robber problem, this problem can simply bedecomposed into two ... 阅读全文
posted @ 2015-06-02 23:17 jianchao-li 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Well, have you solved thenextPermutationproblem? If so and you have handled the cases of duplicates at that problem, your code can be used in this pro... 阅读全文
posted @ 2015-06-02 23:11 jianchao-li 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Well, have you solved thenextPermutationproblem? If so, your code can be used in this problem. The idea is fairly simple:sortnumsin ascending order, a... 阅读全文
posted @ 2015-06-02 23:09 jianchao-li 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Well, in fact the problem of next permutation has been studied long ago. From theWikipedia page, in the 14th century, a man named Narayana Pandita giv... 阅读全文
posted @ 2015-06-02 23:06 jianchao-li 阅读(267) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20