diff --git a/1752. Check if Array Is Sorted and Rotated b/1752. Check if Array Is Sorted and Rotated new file mode 100644 index 0000000..6fae8eb --- /dev/null +++ b/1752. Check if Array Is Sorted and Rotated @@ -0,0 +1,15 @@ +class Solution { +public: + bool check(vector& nums) { + int n = nums.size(); + int count = 0; + + for (int i = 0; i < n; i++) { + if (nums[i] > nums[(i + 1) % n]) { + count++; + } + } + + return count <= 1; + } +};