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

Input: Consider Input: [20, 86, 93, 13, 46, 97, 9, 61, 18, 78]

Output: 2

Input: Consider Input: [92, 44, 43, 88, 42, 91, 54, 51, 79, 45]

Output: 2

Input: Consider Input: [81, 69, 13, 34, 10, 80, 33, 7, 86, 65]
Output: 2