当前位置:网站首页>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]));
}边栏推荐
- wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M
- 移动web布局方法
- Rainbow plug-in extension: monitor MySQL based on MySQL exporter
- 数字信息化(先枚举假设,再看是否满足条件)(1089 狼人杀-简单版)
- 【高等数学】【3】微分中值定理与导数的应用
- 导电滑环在机械设备方面的应用
- 「分享」DevExpress ASP.NET v22.1最新版本系统环境配置要求
- [cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels
- Proxy实现mysql读写分离
- SecureCRT garbled code solution [easy to understand]
猜你喜欢

tiktok手机网络环境怎么设置?tiktok怎么破播放量?

Advantages of network virtualization of various manufacturers

【云原生 | 从零开始学Kubernetes】八、命名空间资源配额以及标签

Stochastic gradient descent method, Newton method, impulse method, adagrad, rmsprop and Adam optimization process and understanding
![MySQL date [plus sign / +] condition filtering problem](/img/86/aed048e27b3e0b0baa919204bc067c.png)
MySQL date [plus sign / +] condition filtering problem
![[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay](/img/18/b06e2e5a2f76dc2da1c2374b8424b3.png)
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay

谷歌Pixel 6a屏下指纹扫描仪存在重大安全漏洞

Jmeter——接口测试

【高等数学】【3】微分中值定理与导数的应用

UNET and mask RCNN
随机推荐
Introduction and construction of consul Registration Center
Detailed evaluation of current popular redis visual management tools
Network RTK UAV test [easy to understand]
火山引擎项亮:机器学习与智能推荐平台多云部署解决方案正式发布
LP dual currency pledge liquidity mining DAPP system development logic analysis
10. < tag dynamic programming and subsequence, subarray> lt.53. maximum subarray and + lt.392. Judge subsequence DBC
PreScan快速入门到精通第十九讲之PreScan执行器配置、轨迹同步及非配多个轨迹
【高等数学】【8】微分方程
[today in history] July 18: Intel was founded; The first photo was posted on the world wide web; EBay spins off PayPal
Web crawler principle analysis "suggestions collection"
wallys//wifi6 wifi5 router IPQ6018 IPQ4019 IPQ4029 802.11ax 802.11ac
Proxy实现mysql读写分离
Redis source code -ziplist
Error when creating dataset with mindscore
How to ensure the quality of customized slip rings
How to set tiktok mobile network environment? How can tiktok break the playback volume?
「分享」DevExpress ASP.NET v22.1最新版本系统环境配置要求
Prescan quick start to master the special functions of prescan track editing in lecture 18
[today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born
Array of sword finger offer question bank summary (I) (C language version)