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

Commit09953b0

Browse files
refactor 1055
1 parent2cf237e commit09953b0

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

‎src/main/java/com/fishercoder/solutions/_1055.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,6 @@
22

33
importjava.util.stream.IntStream;
44

5-
/**
6-
* 1055. Fixed Point
7-
*
8-
* Given an array A of distinct integers sorted in ascending order,
9-
* return the smallest index i that satisfies A[i] == i. Return -1 if no such i exists.
10-
*
11-
* Example 1:
12-
* Input: [-10,-5,0,3,7]
13-
* Output: 3
14-
* Explanation:
15-
* For the given array, A[0] = -10, A[1] = -5, A[2] = 0, A[3] = 3, thus the output is 3.
16-
*
17-
* Example 2:
18-
* Input: [0,2,5,8,17]
19-
* Output: 0
20-
* Explanation:
21-
* A[0] = 0, thus the output is 0.
22-
*
23-
* Example 3:
24-
* Input: [-10,-5,3,4,7,9]
25-
* Output: -1
26-
* Explanation:
27-
* There is no such i that A[i] = i, thus the output is -1.
28-
*
29-
* Note:
30-
*
31-
* 1 <= A.length < 10^4
32-
* -10^9 <= A[i] <= 10^9
33-
* */
345
publicclass_1055 {
356
publicstaticclassSolution1 {
367
publicintfixedPoint(int[]A) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp