当前位置:网站首页>2022.7.24-----leetcode.1184
2022.7.24-----leetcode.1184
2022-07-25 20:10:00 【路Lu727】
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]));
}边栏推荐
- 【高等数学】【8】微分方程
- tga文件格式(波形声音文件格式)
- Rainbow plug-in extension: monitor MySQL based on MySQL exporter
- Rainbond插件扩展:基于Mysql-Exporter监控Mysql
- [mindspore] [read graph data] cannot read mindrecord format graph data
- 如何保证定制滑环质量
- 10. < tag dynamic programming and subsequence, subarray> lt.53. maximum subarray and + lt.392. Judge subsequence DBC
- Legal mix of collations for operation 'Union' (bug record)
- Google pixel 6A off screen fingerprint scanner has major security vulnerabilities
- MySQL 日期【加号/+】条件筛选问题
猜你喜欢
Detailed evaluation of current popular redis visual management tools

Connecting to the database warning establishing SSL connection without server's identity verification is not recommended
![[advanced mathematics] [6] differential calculus of multivariate functions](/img/9e/84fe6f74b58cbaabab1b6eed0df556.png)
[advanced mathematics] [6] differential calculus of multivariate functions
![[cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels](/img/7e/2bdead512ba5bf5ccd0830b0f9b0f2.png)
[cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels

test

YOLOv7论文部分解读【含自己的理解】
![Summarize the level of intelligent manufacturing discussion [macro understanding]](/img/84/3addabdf857c562535a4085782d3e8.png)
Summarize the level of intelligent manufacturing discussion [macro understanding]
[today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET

How to ensure the quality of customized slip rings

Rainbond插件扩展:基于Mysql-Exporter监控Mysql
随机推荐
Sentinel simple current limiting and degradation demo problem record
【高等数学】【6】多元函数微分学
redis源码 -ziplist
qml 结合 QSqlTableModel 动态加载数据 MVC「建议收藏」
How to set tiktok mobile network environment? How can tiktok break the playback volume?
当AI邂逅生命健康,华为云为他们搭建三座桥
From Tong Dai to "Tong Dai" and then to brand, the beauty of sudden profits has changed and remained unchanged
Log in to Baidu online disk with cookies (websites use cookies)
Stochastic gradient descent method, Newton method, impulse method, adagrad, rmsprop and Adam optimization process and understanding
Application of conductive slip ring in mechanical equipment
Rainbond插件扩展:基于Mysql-Exporter监控Mysql
Six axis sensor use learning record
Dataloader reports an error "default_collate: batch must contain tensors, numpy arrays, numbers, dicts" when pytorch trains the model
Detailed evaluation of current popular redis visual management tools
网络爬虫原理解析「建议收藏」
QQ是32位还是64位软件(在哪看电脑是32位还是64位)
String of sword finger offer question bank summary (II) (C language version)
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay
The query data returned by the print database is null or the default value. Does not match the value returned by the database
03-树1 树的同构