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

 

norm.krumpe@muohio.edu exam3section2 > isShrinking
prev  |  next  |  chance

Given an array of integers, return true if each element in the array is exactly one or two smaller than the previous element, and return false otherwise. Arrays will always contain at least two elements.


isShrinking([9, 8, 6]) → true
isShrinking([8, 6, 4, 3]) → true
isShrinking([8, 6, 4, 1]) → false

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

boolean isShrinking(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: 200

Copyright Nick Parlante 2017 - privacy