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: [78, 26, 59, 51, 65, 86, 57, 47, 64, 91]

Answer: 2


Question: [159, 150, 141, 132, 123, 114, 105, 96, 87, 78, 69, 60, 51, 42, 33]

Answer: 1


Question: [179, 173, 167, 161, 155, 149, 143, 137, 131, 125, 119, 113, 107, 101, 95, 89, 83, 77, 71, 65, 59, 53, 47, 41, 35]

Answer:
1