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

Ex Input:
[7, 68, 4, 23, 34, 61, 98, 5, 15, 26]

Ex Output:
2


Ex Input:
[62, 5, 16, 87, 73, 24, 43, 57, 6, 51]

Ex Output:
2


Ex Input:
[10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162]

Ex Output:

1