递归
JRUBYcsdn
这个作者很懒,什么都没留下…
展开
-
金额查错
某财务部门结账时发现总金额不对头。很可能是从明细上漏掉了某1笔或几笔。如果已知明细账目清单,能通过编程找到漏掉的是哪1笔或几笔吗?如果有多种可能,则输出所有可能的情况。我们规定:用户输入的第一行是:有错的总金额。接下来是一个整数n,表示下面将要输入的明细账目的条数。再接下来是n行整数,分别表示每笔账目的金额。要求程序输出:所有可能漏掉的金额组合。每个情况1行。金额按照从小到大排列,中间用空格分开。...原创 2018-03-31 09:18:48 · 356 阅读 · 0 评论 -
LeetCode 198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...原创 2018-05-20 16:13:56 · 124 阅读 · 0 评论 -
LeetCode 416. Partition Equal Subset Sum
Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note:Each of the array element w...原创 2018-05-20 22:38:08 · 122 阅读 · 0 评论