Tap here to switch tabs
Problem
Submissions

Problem: Fixed Point

med
30 min
Try to solve the Fixed Point problem.

Statement

Given an array of distinct integers arr sorted in ascending order, return the smallest index i such that arr[i] == i. If no such index exists, return −1-1.

Constraints:

  • 1≤1 \leq arr.length <104< 10^4

  • −109≤-10^9 \leq arr[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Fixed Point

med
30 min
Try to solve the Fixed Point problem.

Statement

Given an array of distinct integers arr sorted in ascending order, return the smallest index i such that arr[i] == i. If no such index exists, return −1-1.

Constraints:

  • 1≤1 \leq arr.length <104< 10^4

  • −109≤-10^9 \leq arr[i] ≤109\leq 10^9