URL: https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/ Signed-off-by: Matej Focko <me@mfocko.xyz>
5 lines
169 B
C#
5 lines
169 B
C#
public class Solution {
|
|
public bool Check(int[] nums) => Enumerable
|
|
.Range(0, nums.Length)
|
|
.Count(i => nums[i] > nums[(i + 1) % nums.Length]) < 2;
|
|
}
|