about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy