-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblank.java
More file actions
28 lines (25 loc) · 764 Bytes
/
blank.java
File metadata and controls
28 lines (25 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.*;
public class blank {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
int blank = 0, blank1 = 0;
int n2 = sc.nextInt();
int arr[] = new int[n2];
for (int j = 0; j < n2; j++) {
arr[j] = sc.nextInt();
}
for (int j = 0; j < n2; j++) {
if (arr[j] == 0) {
blank++;
blank1 = Math.max(blank, blank1);
} else {
blank = 0;
}
}
System.out.println(blank1);
}
sc.close();
}
}