cs: add «1752. Check if Array Is Sorted and Rotated»

URL:	https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/
Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2025-02-02 14:43:26 +01:00
parent 1e2d16c0d5
commit 349e7a8914
Signed by: mfocko
SSH key fingerprint: SHA256:icm0fIOSJUpy5+1x23sfr+hLtF9UhY8VpMC7H4WFJP8

View file

@ -0,0 +1,5 @@
public class Solution {
public bool Check(int[] nums) => Enumerable
.Range(0, nums.Length)
.Count(i => nums[i] > nums[(i + 1) % nums.Length]) < 2;
}