当前位置:网站首页>2022.7.24-----leetcode.1184
2022.7.24-----leetcode.1184
2022-07-25 20:18:00 【Lu 727】
public int distanceBetweenBusStops(int[] distance, int start, int destination) {
int n=distance.length;
int[] pre=new int[n+1];
for(int i=0;i<n;i++){
pre[i+1]=pre[i]+distance[i];
}
int max=Math.max(start,destination);
int min=Math.min(start,destination);
return Math.min(pre[max]-pre[min],pre[n]-(pre[max]-pre[min]));
}边栏推荐
- Google pixel 6A off screen fingerprint scanner has major security vulnerabilities
- Link list of sword finger offer question bank summary (III) (C language version)
- Technology cloud report: what is the difference between zero trust and SASE? The answer is not really important
- redis源码 -ziplist
- Summarize the level of intelligent manufacturing discussion [macro understanding]
- 智能电子界桩自然保护区远程监控解决方案
- 什么是聚类分析?聚类分析方法的类别[通俗易懂]
- What is the method to load the torch pre trained model for the mindspore model finetune?
- 4、Nacos 配置中心源码解析之 服务端启动
- 【高等数学】【6】多元函数微分学
猜你喜欢

PreScan快速入门到精通第十九讲之PreScan执行器配置、轨迹同步及非配多个轨迹

Jmeter——接口测试

Application of conductive slip ring in mechanical equipment
![[today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born](/img/0b/73f0d98a6db813e54074abe199ed98.png)
[today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born

03 isomorphism of tree 1

Technology cloud report: what is the difference between zero trust and SASE? The answer is not really important
![Interpretation of repartitioned network structure in repvgg network [with code]](/img/0b/a2f3b312899043c9d5b9c7d6b22261.png)
Interpretation of repartitioned network structure in repvgg network [with code]

参与开源社区还有证书拿?
![[advanced mathematics] [4] indefinite integral](/img/4f/2aae654599fcc0ee85cb1ba46c9afd.png)
[advanced mathematics] [4] indefinite integral

Do you still have certificates to participate in the open source community?
随机推荐
[today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET
Working principle of radar water level gauge and precautions for installation and maintenance
网络RTK无人机上机测试[通俗易懂]
Digital informatization (enumerate assumptions first, and then see whether the conditions are met) (1089 werewolf kill - simple version)
PMP adopts the latest exam outline, here is [agile project management]
[advanced mathematics] [8] differential equation
Proxy implements MySQL read / write separation
From Tong Dai to "Tong Dai" and then to brand, the beauty of sudden profits has changed and remained unchanged
Configure and install cocos2dx development environment under Tongxin UOS
飞行器pid控制(旋翼飞控)
CarSim仿真快速入门(十四)—CarSim-Simulink联合仿真
Export and call of onnx file of pytorch model
Socket error Event: 32 Error: 10053. Connection closing...Socket close
Recommendations on how to install plug-ins and baby plug-ins in idea
Sentinel simple current limiting and degradation demo problem record
Detailed evaluation of current popular redis visual management tools
DIY个人服务器(diy存储服务器)
qml 结合 QSqlTableModel 动态加载数据 MVC「建议收藏」
test
LP dual currency pledge liquidity mining DAPP system development logic analysis