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: [32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136]
Example Output: 1

Example Input: [6, 62, 90, 10, 27, 71, 40, 67, 64, 47]
Example Output: 2

Example Input: [109, 102, 95, 88, 81, 74, 67, 60, 53, 46, 39]
Example Output:
1