about | help | code help+videos | done | prefs |
Given an array of integers, a flat-hill is a sequence of 4 consecutive elements such that the first element is smaller than the second, the second is equal to the third, and the third is greater than the fourth. Write a function that gets as an input an array of integers, and returns true if it contains a flat hill, and false otherwise. flatHill([1, 2, 3, 4]) → false flatHill([1, 2, 3, 3, 2, 1]) → true flatHill([1, 2, 3, 3, 3, 4]) → 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: 100
Copyright Nick Parlante 2017 - privacy