id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

find


Given an array and a key, return the index of the first element in the array that matches the key. If no element matches the key, return -1.


find([5, 4, 5], 4) → 1
find([5, 4, 5], 5) → 0
find([5, 4, 5], 6) → -1

...Save, Compile, Run (ctrl-enter)

int find(int[] nums, int key) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 200

Copyright Nick Parlante 2017 - privacy