Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 09953b0

Browse files
refactor 1055
1 parent 2cf237e commit 09953b0

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
import java.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
public class _1055 {
356
public static class Solution1 {
367
public int fixedPoint(int[] A) {

0 commit comments

Comments
 (0)