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]: [170, 163, 156, 149, 142, 135, 128, 121, 114, 107, 100, 93, 86, 79, 72, 65, 58, 51, 44, 37, 30, 23, 16, 9]
[EX A]: 1

[EX Q]: [58, 57, 28, 98, 25, 53, 38, 29, 33, 11]
[EX A]: 2

[EX Q]: [25, 67, 73, 85, 50, 7, 97, 17, 43, 38]
[EX A]:
2