Check If The Array Is Sorted Leetcode