PROBLEMS
void reverseArray(vector<int> &arr , int m)
{
int start=m+1;
int end=[Link]()-1;
while(start<=end)
{
swap(arr[start],arr[end]);
start++;
end--;
}
}
class Solution {
public:
void rotate(vector<int>& nums, int k) {
vector<int> temp([Link]());
for(int i=0;i<[Link]();i++)
{
temp[(i+k)%[Link]()]=nums[i];
}
// copying element of temp in nums
nums=temp;
}
};
class Solution {
public:
bool check(vector<int>& nums) {
int n=[Link]();
int count=0;
for(int i=1;i<n;i++)
{
if(nums[i-1]>nums[i])
count++;
}
if(nums[n-1]>nums[0])
{
count++;
}
/* if(count<=1)
{return true;
}
else{
return false;
}*/
return count<=1;
}
};