In this article, we will learn to check whether the array is monotonic or not using the python program.
What is the monotonic array?
An array that is continuous increases or continuous decreases is said to be a monotonic array.
Let's take any array,
arr = [1, 2, 3, 4, 5, 6 ]
when i <= j
arr[i] <= arr[j]
Then this array is said to be monotnic increasing.
arr = [11, 8, 5, 2, 1]
when i >=j
arr[i] >= arr[j]
Then this array is said to be monotonic decreasing.