My approach was to figure out using the first two unique numbers if the array is increasing or decreasing, if its increasing, that means new numbers must not be less than the last number and if its a decreasing array, then subsequent numbers must not be greater than the previous number. Based on this conditions, we are able to do an early false return for non-monotonic arrays, and if all checks, we return a true