X1706: Find position of value

Given an array of integers numbers and a value, return the index of the position where the value is found in numbers or -1 if the value is not found. Note that the array might be empty (i.e. 0 length array).

Examples:

findPos({1,3,2,5},3) -> 1
findPos({1,3,2,5},1) -> 0
findPos({1,3,2,5},4) -> -1

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.