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

 

abraskin@mbusd.org problemset09 > nonAscIndex
prev  |  next  |  chance

Given an array, return the first index of an element that is out of ascending order if there is one and -1 if all the elements in the array are in ascending order.


nonAscIndex([1, 2, 3]) → -1
nonAscIndex([1, 1, 1]) → -1
nonAscIndex([1, 2, 1, 3, 4]) → 2

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

public int nonAscIndex(int[] arr) { }

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: 100

Copyright Nick Parlante 2017 - privacy