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: [85, 78, 15, 4, 92, 46, 98, 81, 38, 86]

A: 2
****
Q: [70, 74, 90, 85, 92, 3, 63, 57, 53, 91]

A: 2
****
Q: [48, 71, 3, 82, 87, 96, 86, 57, 69, 59]

A:
2
****