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]: [78, 26, 59, 51, 65, 86, 57, 47, 64, 91]
[EX A]: 2

[EX Q]: [163, 154, 145, 136, 127, 118, 109, 100, 91, 82, 73, 64, 55, 46, 37]
[EX A]: 1

[EX Q]: [29, 38, 47, 56, 65, 74, 83, 92, 101, 110, 119, 128, 137, 146, 155]
[EX A]:
1