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

 

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

Return the position of first negative number. If the array is composed of Natural numbers, return -1.


indexNeg([3, 4, -4]) → 2
indexNeg([8, 9, 8, 32]) → -1
indexNeg([-5, 2, 3, 3]) → 0

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

public int indexNeg( int [ ] vals) { }

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