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:
[31, 38, 72, 90, 93, 20, 45, 40, 52, 41]

Ex Output:
2


Ex Input:
[99, 2, 21, 75, 68, 11, 60, 96, 30, 38]

Ex Output:
2


Ex Input:
[80, 4, 43, 3, 2, 11, 83, 93, 38, 59]

Ex Output:

2