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

 

jebbert@volusia.k12.fl.us > rrr3justIncreasing
prev  |  next  |  chance

Write a method that returns 'true' if an array of integers is strictly increasing, 'false' otherwise. However, any instance of the number that matches the 'except' parameter can be out of order. So the array {3,7,5,8,12,5,14} is NOT in strictly increasing order, but if we make an exception for the number 5, then it IS in strictly increasing order. Note that the 'except' value might not appear in the array at all. Also note that an empty array or an array of length one will always be in strictly increasing order. The "strictly" part of the increasing order refers to the fact that each number must be greater than the previous (with the already mentioned exception). So if two consecutive numbers match, that is NOT considered strictly increasing (such as {6, 14, 14, 20}). Whenever the 'except' value is found, that starts a new series of numbers, so it does not matter if the number after the 'except' values is greater than, less than, or equal to the number before the 'except' value. So {5,8,12,100,7,8,12} with an 'except' value of 100 would return TRUE even though 7 is less than 12 because the sequence resets when 100 is encountered.


rrr3justIncreasing([5, 15, 25, 35, 6], 1) → false
rrr3justIncreasing([16, 5, 14, 18, 20, 22], 5) → true
rrr3justIncreasing([], 452) → true

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

public boolean rrr3justIncreasing(int[] nums, int except) { }

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

Copyright Nick Parlante 2017 - privacy