about | help | code help+videos | done | prefs |
queue_consecutiveOrder
Given a queue of integers, return true if all of the integers are in consecutive order counting up OR if all of the integers are in consecutive order counting down. Consecutive order increasing means that the next value is exactly one value higher than the previous. Consecutive order decreasing means that the next value is exactly one value lower than the previous. queue_consecutiveOrder([1, 2, 3, 4]) → true queue_consecutiveOrder([4, 3, 2, 1]) → true queue_consecutiveOrder([2, 4, 6, 8]) → 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
Copyright Nick Parlante 2017 - privacy