Skip to content

Commit

Permalink
如何捅破python编程的那层纸之二
Browse files Browse the repository at this point in the history
  • Loading branch information
likepython committed Jul 23, 2015
1 parent 19c8bf5 commit 9c1af09
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pythonstudy2.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
sameSums([3, 3]) --> True
sameSums([4, 12, 16]) --> True //4+12= 16 and 16
sameSums([5, 1]) --> False
特别提示:这个题目,贪心算法只能计算上面这样的情况。
这个题目,对初学者来说,有点难度,但稍微有点算法基础,编程思路,就不难。
先讲一个故事:二个小孩儿时从树上采板栗,最后合并一堆,分板栗,采集一人选一个的分。
假定人性是贪婪的,第一个先选的人,选最大的,第二个选的人,选次大的,一直循环下去。
Expand Down

0 comments on commit 9c1af09

Please sign in to comment.