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]: [34, 40, 46, 52, 58, 64, 70, 76, 82, 88, 94, 100, 106, 112, 118, 124, 130, 136, 142, 148, 154, 160, 166, 172, 178]
[EX A]: 1

[EX Q]: [98, 74, 39, 52, 59, 70, 64, 10, 47, 19]
[EX A]: 2

[EX Q]: [45, 90, 64, 95, 66, 26, 76, 7, 74, 38]
[EX A]:
2