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

 

sspiege3@schools.nyc.gov > posOf4
prev  |  next  |  chance

Find the first position of the value 4 in an array. Return -1 if 4 does not exist.


posOf4([4, 1, 2, 3]) → 0
posOf4([1, 4, 2, 3]) → 1
posOf4([6, 5, 6, 7, 8]) → -1

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

public int posOf4( int [] nums){ }

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: 202 Post-solution available

Copyright Nick Parlante 2017 - privacy