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: [174, 166, 158, 150, 142, 134, 126, 118, 110, 102, 94, 86, 78, 70, 62, 54, 46, 38]

Answer: 1


Question: [47, 56, 65, 74, 83, 92, 101, 110, 119, 128, 137, 146, 155, 164, 173, 182, 191]

Answer: 1


Question: [170, 160, 150, 140, 130, 120, 110, 100, 90, 80, 70, 60, 50, 40]

Answer:
1