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

Example Input: [86, 50, 98, 96, 66, 38, 57, 56, 58, 65]
Example Output: 2

Example Input: [199, 189, 179, 169, 159, 149, 139, 129, 119, 109, 99, 89, 79, 69, 59, 49, 39, 29, 19]
Example Output:
1