bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
EasyArrays & HashingLC 896

Monotonic Array

An array is monotonic if it is either monotone increasing or monotone decreasing. An array nums is monotone increasing if for all i = nums[j]. Given an integer array nums, return true if the given array is monotonic, or false otherwise.

Asked at 1 company
Facebook
Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode