Array Index & Element Equality #122
Replies: 4 comments
-
`import java.io.; class Solution { static int indexEqualsValueSearch(int[] arr) {
// for(int i = 0; i < arr.length; i++){
} public static void main(String[] args) { } }` |
Beta Was this translation helpful? Give feedback.
-
Bildschirmaufnahme.2023-01-26.um.11.52.04.movBildschirmaufnahme.2023-01-26.um.11.49.59.movBildschirmaufnahme.2023-01-26.um.11.49.05.mov |
Beta Was this translation helpful? Give feedback.
-
`package pramp; public class HTree {
public static void drawHTree(double x, double y, double length, int depth)
}` |
Beta Was this translation helpful? Give feedback.
-
EXAMPLES:
`input: arr = [-8,0,2,5]
output: 2 # since arr[2] == 2
input: arr = [-1,0,3,6]
output: -1 # since no index in arr satisfies arr[i] == i.`
Constraints:
[time limit] 5000ms
[input] array.integer arr
1 ≤ arr.length ≤ 100
[output] integer
Beta Was this translation helpful? Give feedback.
All reactions