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

[154, 150, 146, 142, 138, 134, 130, 126, 122, 118, 114, 110, 106, 102, 98, 94, 90, 86, 82, 78, 74, 70, 66, 62, 58, 54, 50, 46, 42, 38, 34, 30, 26, 22, 18, 14]
1

[46, 56, 16, 32, 99, 30, 57, 93, 64, 28]
2

[195, 186, 177, 168, 159, 150, 141, 132, 123, 114, 105, 96, 87, 78, 69, 60, 51]

1