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

[EX Q]: [3, 75, 96, 40, 12, 21, 95, 4, 80, 85]
[EX A]: 2

[EX Q]: [10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162]
[EX A]: 1

[EX Q]: [169, 161, 153, 145, 137, 129, 121, 113, 105, 97, 89, 81, 73, 65, 57, 49]
[EX A]:
1