public static int indexOf(int[] a, int target) {
for (int i = 0; i < a.length; i++) {
if (/* missing */) return i;
}
return -1;
}Which condition replaces /* missing */?
- A
a[target] == i
- B
a == target
- C
i == target
- Dcheck_circle
a[i] == target
Explanation
Compare the current array element to the target value, returning the index when they match.