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:
[109, 102, 95, 88, 81, 74, 67, 60, 53, 46, 39]

Ex Output:
1


Ex Input:
[170, 160, 150, 140, 130, 120, 110, 100, 90, 80, 70, 60, 50, 40]

Ex Output:
1


Ex Input:
[113, 107, 101, 95, 89, 83, 77, 71, 65, 59, 53, 47, 41, 35, 29, 23, 17, 11]

Ex Output:

1