当前位置:网站首页>2022.5.30-----leetcode. one thousand and twenty-two
2022.5.30-----leetcode. one thousand and twenty-two
2022-06-10 04:45:00 【Lu 727】
// Simulated stack recursion
int ans=0;
String s="";
public int sumRootToLeaf(TreeNode root) {
dfs(root);
return ans;
}
void dfs(TreeNode root){
s+=root.val;
if(root.left==null&&root.right==null)
ans+=Integer.parseInt(s,2);
if(root.left!=null){
dfs(root.left);
s=s.substring(0,s.length()-1);
}
if(root.right!=null){
dfs(root.right);
s=s.substring(0,s.length()-1);
}
}边栏推荐
- Metersphere | a super easy-to-use open source testing platform
- An error is reported in the mindspore training phase: not find op[add] in AKG
- [android l]seandrod security enhancement background summary and impact
- Basic methods of stack and related problems
- Informatics Olympiad all in one 1274: [example 9.18] merging pebbles | Luogu p1775 pebbles merging (weakened version)
- AI candidates challenge the composition of the college entrance examination, generating one essay in one second on average, with the level of more than 75% of the candidates
- MindSpore【初学入门】教程在线运行时报错
- 【通用数据库工具】上海道宁为开发者、分析师、数据库管理员带来适用于所有数据库和操作系统的工具——DbVisualizer
- S系列·删除文件夹的几种姿势
- Openjudge noi 1.13 14: find the 3 digits that meet the conditions
猜你喜欢

2022 Shandong Province safety officer C certificate examination question bank and answers

Figure out the difference between firmware, driver and software

2022 refrigeration and air conditioning equipment operation special operation certificate examination question bank simulated examination platform operation
![An error is reported in the mindspore training phase: not find op[add] in AKG](/img/df/5ccc43e0d115b487dc3a38129bc88b.png)
An error is reported in the mindspore training phase: not find op[add] in AKG

使用 Locust 进行 Kubernetes 分布式性能测试

使用MindSpore在GPU-PYNATIVE/ CPU-GRAPH_MODE 与 GPU-GRAPH_MODE 执行不一致

2022危险化学品经营单位主要负责人考试试题及在线模拟考试

Examination questions and online simulation examination of the third batch of Guangdong Provincial Safety Officer a certificate (principal) in 2022

Email: analysis of wrong arrangement

ThreadLocal basic and advanced use
随机推荐
Mix sampling and loading with mindspire multiple datasets
2022年流动式起重机司机考试题及在线模拟考试
APISpace 分钟级降水预报API接口 免费好用
2022年危险化学品生产单位安全生产管理人员操作证考试题库及答案
How to use API interface of national weather forecast for rapid development
Celery | task queue artifact
25. BOM事件
Fastapi-16-page beautification-1
常见的数据库-字段类型映射关系
Fastapi-14-file upload-2
Tutorial on using midway
Apispace tail limit API interface is free and easy to use
Tcp/ip protocol (1)
Puzzling color deviation of unity illumination black
City / school / major, which is the most important when choosing a university| Daily anecdotes
Quic must see
OpenJudge NOI 1.13 13:人民币支付
Use mindspire in gpu-national/ cpu-graph_ Mode and gpu-graph_ Inconsistent mode execution
mindspore1.6conda安装gpu版本验证失败
Kubernetes distributed performance test using locust