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

Example Input: [55, 68, 64, 80, 5, 87, 39, 88, 73, 45]
Example Output: 2

Example Input: [92, 44, 43, 88, 42, 91, 54, 51, 79, 45]
Example Output: 2

Example Input: [68, 33, 21, 85, 24, 59, 93, 55, 78, 13]
Example Output:
2