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]: [96, 85, 77, 11, 60, 55, 34, 37, 46, 10]
[EX A]: 2

[EX Q]: [28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 116, 124, 132, 140, 148, 156, 164, 172]
[EX A]: 1

[EX Q]: [43, 91, 52, 80, 67, 34, 10, 29, 11, 74]
[EX A]:
2