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: [55, 68, 64, 80, 5, 87, 39, 88, 73, 45]

A: 2
****
Q: [96, 85, 77, 11, 60, 55, 34, 37, 46, 10]

A: 2
****
Q: [20, 89, 21, 29, 34, 39, 61, 78, 27, 69]

A:
2
****