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

[21, 30, 39, 48, 57, 66, 75, 84, 93, 102, 111, 120, 129, 138, 147]
1

[96, 85, 77, 11, 60, 55, 34, 37, 46, 10]
2

[49, 57, 65, 73, 81, 89, 97]

1