β Moving right (Contest)
Moving right (Contest) easy Time Limit: 2 sec Memory Limit: 128000 kB
```java
import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework
// don't change the name of this class
// you can add inner classes if needed
class Main {
public static void main (String[] args) {
// Your code here
Scanner sc= new Scanner(System.in);
int N=sc.nextInt();
int arr[]=new int[N];
for(int i=0;i<N;i++){
arr[i]=sc.nextInt();
}
int count=0;
int curr=arr[0];
int max=0;
for(int i=1;i<arr.length;i++){
if(arr[i]<=curr){
count+=1;
max=Math.max(max,count);
curr=arr[i];
}else{
count=0;
curr=arr[i];
}
}
System.out.print(max);
}
}
```Last updated