# Monotonic Array Lab

Easy

7

43.6% Acceptance

In this lab, you will be working with **monotonic arrays**. An array is considered monotonic if it is either monotone increasing or monotone decreasing. Monotone increasing means that for all `i <= j`

, `nums[i] <= nums[j]`

. Monotone decreasing means that for all `i <= j`

, `nums[i] >= nums[j]`

. Your task is to create a function that takes an integer array `nums`

and returns `true`

if the given array is monotonic, and `false`

otherwise.

To help you better understand the problem, consider the following examples:

`isMonotonic([1, 2, 2, 3]) // true isMonotonic([6, 5, 4, 4]) // true isMonotonic([1, 3, 2]) // false`

## Challenges

- Export the
`isMonotonic`

function from your`index.js`

file. - Implement the
`isMonotonic`

function to correctly identify monotonic arrays based on the given constraints:`1 <= nums.length <= 10^5`

`-10^5 <= nums[i] <= 10^5`

- Make sure your export the function