Write a function find_index(arr, value) that returns the index of the first occurrence of a given value in an array. Return -1 if the value is not found.
Example:
Input: arr = [10, 20, 30, 40, 50], value = 30
Output: 2
Constraints:
Test Cases
Test Case 1
Input:
[10, 20, 30, 40, 50], 30Expected:
2Test Case 2
Input:
[1, 2, 3, 4, 5], 1Expected:
0Test Case 3
Input:
[1, 2, 3], 7Expected:
-1+ 2 hidden test cases