To determine if an array is monotonic, check if it is either entirely non-increasing or non-decreasing. If either condition holds true throughout the array, return true; otherwise, return false.
3 окт 2024