Combination Sum
Total Accepted: 17319 Total
Submissions: 65259My Submissions
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
the ca...
分类:
其他好文 时间:
2014-09-01 12:42:03
阅读次数:
259
树的求和属于树的题目中比较常见的,因为可以有几种变体,灵活度比较高,也可以考察到对于树的数据结构和递归的理解。一般来说这些题目就不用考虑非递归的解法了(虽然其实道理是跟LeetCode总结 -- 树的遍历篇一样的,只要掌握了应该没问题哈)。 LeetCode中关于树的求和有以下题目:Path SumPath Sum IISum Root to Leaf NumbersBinary Tree Max...
分类:
其他好文 时间:
2014-09-01 10:45:53
阅读次数:
147
GCD SUMTime Limit:8000/4000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others)SubmitStatisticNext ProblemProblem Description给出N,M执行如下程序:long lon...
分类:
其他好文 时间:
2014-09-01 08:09:42
阅读次数:
201
Path Sum
Total Accepted: 20393 Total
Submissions: 66674My Submissions
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along...
分类:
其他好文 时间:
2014-08-31 21:33:41
阅读次数:
284
Path Sum II
Total Accepted: 18489 Total
Submissions: 68323My Submissions
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For exampl...
分类:
其他好文 时间:
2014-08-31 21:28:11
阅读次数:
180
Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ...
分类:
其他好文 时间:
2014-08-31 19:59:31
阅读次数:
209
bash中的算术运算: 操作符+、-、*、/、% declare: -i:整型变量 -x:环境变量,类似于export 1、let:进行算术运算,格式为letvarName=算术表达式 如果计算结果为小数,小数部分被省略。 如:letsum=4+1,结果为5 echo$sum lets=16/3,结果为5 echo$s 2、varName=$[算术表达..
分类:
其他好文 时间:
2014-08-31 18:50:42
阅读次数:
218
新财年年初到今天的销售总和是很多同学经常遇到的需求,有两种思路:
1. 可以在Load数据的时候就生成一个字段叫YTDFlag,即是当下这个财年的该字段就为1,否则为0。因此在报表中可以很方便的用Sum(Sales * YTDFlag)来得到想要的KPI。
Load数据的Script如下所示:
SalesData:
LOAD
Num(ID) as ID,
Date(Date) as...
分类:
其他好文 时间:
2014-08-31 17:17:01
阅读次数:
225
继续接上一篇的内容,本文主要是简述总计和折叠 1.在Dept列右击,选择插入行->组内部下方(每个部门的Total),插入新的一行,并拆分单元格,然后合并列 3.设置文本框属性,格式为Total+部门名称,如下步骤 4.在SalePrice右击设置文本框属性,使用Sum...
分类:
其他好文 时间:
2014-08-31 17:10:41
阅读次数:
199
题意:
给出一串括号
给出一些询问,问某个区间[l,r]内的能合法匹配的括号数有多少个
分析:
我们可以实现处理两个数组
sum[i] 1....i中已经能匹配的右括号的数目
left[i] 1....i中还不能匹配的左括号数目
这两个数组可以很简单的扫描一遍动态维护得出来
我们可以先求前缀和,即
1...m中有多少能匹配的右括号sum[m]
则,我们可以得到s...
分类:
其他好文 时间:
2014-08-31 15:54:31
阅读次数:
262