You are given an array of integers, check if it is monotonic or not. If the array is monotonic, then return 1, else return 2. An array is monotonic if it is either monotonically increasing or monotonocally decreasing. An array is monotonically increasing/decreasing if its elements increase/decrease as we move from left to right
--------
Question: [154, 145, 136, 127, 118, 109, 100, 91, 82, 73, 64, 55, 46, 37, 28]

Answer: 1


Question: [32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136]

Answer: 1


Question: [7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, 111, 119, 127, 135, 143, 151, 159, 167, 175, 183]

Answer:
1