plz tell my mistake
1 test case of increasing decreasing sequence is failed
Please post the correct link to your code. I don’t see no code on opening this link
import java.util.*;
public class Main {
public static void main(String args[]) {
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();
boolean b= true;
int i=0;
for(i = 0; i < n-1; i++)
{
if (arr[i] < arr[i + 1]){
break;
}
}
i++;
for (; i < n-1; ++i){
if(arr[i] > arr[i + 1]){
b= false;
}
}
System.out.println(b);
}
}
change the checking conditions to less than equal to and greater than equal to resp.