y*d
2 楼
just started leetcode practice.
has a question about #113:
public class Solution {
public List
has a question about #113:
public class Solution {
public List
- > pathSum(TreeNode root, int sum) {
List
- > all = new ArrayList();
findPathSum(root, sum, all, new ArrayList());
return all;
}
private void findPathSum(TreeNode node, int sum, List
- >
result, List
if (node == null) {
return;
}
l.add(node.val);
if (node.left == null && node.right == null && node.val == sum) {
// has to make a copy, otherwise the content may be changed
ArrayList
result.add(curPath);
}
findPathSum(node.left, sum - node.val, result, l);
findPathSum(node.right, sum - node.val, result, l);
l.remove(l.size() - 1);
}
}
why is l.remove(l.size() - 1);?
d*u
3 楼
宝宝一岁回去的,现在2岁多一点(5天),现在打算让姥姥带回美国。还需要想走时侯
出个授权书么?带旅行证和护照就行吧? 2岁买不了婴儿便宜机票了吧?
谢谢
出个授权书么?带旅行证和护照就行吧? 2岁买不了婴儿便宜机票了吧?
谢谢
U*y
4 楼
pai
c*t
5 楼
backtracking, it removes node value from list
【在 y*******d 的大作中提到】
: just started leetcode practice.
: has a question about #113:
: public class Solution {
: public List
【在 y*******d 的大作中提到】
: just started leetcode practice.
: has a question about #113:
: public class Solution {
: public List
- > pathSum(TreeNode root, int sum) {
: List
- > all = new ArrayList();
: findPathSum(root, sum, all, new ArrayList());
: return all;
: }
:
: private void findPathSum(TreeNode node, int sum, List
- >
h*3
6 楼
帮顶下
s*g
8 楼
backtracking一般都要repair
不然下一个尝试怎么做
这个就是repair
【在 y*******d 的大作中提到】
: just started leetcode practice.
: has a question about #113:
: public class Solution {
: public List
不然下一个尝试怎么做
这个就是repair
【在 y*******d 的大作中提到】
: just started leetcode practice.
: has a question about #113:
: public class Solution {
: public List
- > pathSum(TreeNode root, int sum) {
: List
- > all = new ArrayList();
: findPathSum(root, sum, all, new ArrayList());
: return all;
: }
:
: private void findPathSum(TreeNode node, int sum, List
- >
S*P
11 楼
Question: What did you use when the baby went back to China? 旅行证 only? If
so, there would be no record on the baby's US 护照. Will it be a problem
when the baby comes back to US? Do you know what to show when the baby leave
China and enter the US seperately?
Sorry, can not type Chinese.
Thank you!
【在 d*********u 的大作中提到】
: 宝宝一岁回去的,现在2岁多一点(5天),现在打算让姥姥带回美国。还需要想走时侯
: 出个授权书么?带旅行证和护照就行吧? 2岁买不了婴儿便宜机票了吧?
: 谢谢
so, there would be no record on the baby's US 护照. Will it be a problem
when the baby comes back to US? Do you know what to show when the baby leave
China and enter the US seperately?
Sorry, can not type Chinese.
Thank you!
【在 d*********u 的大作中提到】
: 宝宝一岁回去的,现在2岁多一点(5天),现在打算让姥姥带回美国。还需要想走时侯
: 出个授权书么?带旅行证和护照就行吧? 2岁买不了婴儿便宜机票了吧?
: 谢谢
p*r
12 楼
bso
d*u
13 楼
你问的问题我也不知道呀,有人了解 赶紧帮解释一下吧。 走的时候拿的旅行证和护照
,好象就看看,护照上啥也没有。
昨天我爸爸还说 听别人说美国小孩到机场要5000块钱。虽然怪异,还是问一下。
,好象就看看,护照上啥也没有。
昨天我爸爸还说 听别人说美国小孩到机场要5000块钱。虽然怪异,还是问一下。
h*3
16 楼
更郁闷的是,回来国米米兰德比输了。
c*u
17 楼
旅行证是孩子进入中国的有效证件,虽然孩子在美国出生,但旅行证的作用相当于中国
护照。
美国护照是孩子将来回美国的有效证件。
护照。
美国护照是孩子将来回美国的有效证件。
w*r
18 楼
bso
b*6
20 楼
pai
s*j
22 楼
PAI
相关阅读
昨晚把娃掉地上了看到这个帖我都快哭了。愿老天爷保佑她!这年纪了读书是不是老了没有gas和spit up的娃可以吃gas和spit up的奶粉吗?借人气请教-如何保护ipod上的照片不被宝宝删除?S家 go and grow奶票能买一段的奶粉么?fisher price的这两款sleeper有什么区别?请推荐一款适合小婴儿的轻便Stroller有mm需要gymbuck么?转让北京火车站有送人上车的没?请问一下这种情况正常吗? (转载)b2延期经验分享求教:后知后觉的发现B超结果宝宝双顶径BPD只有19%转Britax stroller UPC code郁闷死了。总被我妈说。想问问生娃两个保险的问题(got)求Gymboree的20%coupon[bssd]产经-大头宝宝老师要是得flu, 孩子还照常去familycare吗?小S月子餐日记