Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb767951

Browse files
authored
Create 1266_Minimum_Time_Visiting_All_Points.java
1 parentfd3b980 commitb767951

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// id: 1266
2+
// Name: Minimum Time Visiting All Points
3+
// link: https://leetcode.com/problems/minimum-time-visiting-all-points/
4+
// Difficulty: Easy
5+
6+
classSolution {
7+
publicintminTimeToVisitAllPoints(int[][]points) {
8+
intresult =0;
9+
10+
for (inti =1;i <points.length;i++) {
11+
result +=Math.max(Math.abs(points[i][0] -points[i-1][0]),Math.abs(points[i][1] -points[i-1][1]));
12+
}
13+
returnresult;
14+
}
15+
}
16+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp