get one test case wrong
Increasing decreasing sequence doubt please solve it
Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int i = 0; int a[] = new int[n]; int r = 0; while (i < n) { a[i] = sc.nextInt(); i++; } boolean sec = true; while (r < n) { if (r < n - 1) { if (a[r] < a[r + 1]) { sec = true; } else { sec = false; break; } }else { sec = true; } r++; } if (sec == true) { System.out.println(“true”); } else { System.out.println(“false”); }
Please paste your code to ide.codingblocks.com, save it and then share the link here. The code you have shared is not readable