Example 1 · empty
- Arguments
- values
[]
target0
- Expected return
-1
Test data
- Input
{"values":[],"target":0}- Expected output
-1
func FirstTargetIndex(values []int, target int) intExamples use {"values": [...], "target": ...}.
The runner calls your functions directly; you do not need to parse JSON.
[]
0
-1
{"values":[],"target":0}-1
[ 1, 2, 2, 2, 5 ]
2
1
{"values":[1,2,2,2,5],"target":2}1
[ 1, 3, 7 ]
4
-1
{"values":[1,3,7],"target":4}-1
[ -4, 0, 8 ]
8
2
{"values":[-4,0,8],"target":8}2
Loading…
Checking execution availability…
View inputs and expected outputs. Examples do not run your code.