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

[Q]: [22, 0, 4, 45, 87, 13, 38, 35, 12, 72]
[A]: 2


[Q]: [55, 68, 64, 80, 5, 87, 39, 88, 73, 45]
[A]: 2


[Q]: [26, 65, 35, 76, 80, 18, 74, 19, 32, 78]
[A]:
2