-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day13.java
46 lines (39 loc) · 1.35 KB
/
Day13.java
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.thehuglio;
import javax.swing.*;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
public class Main {
private static final List<String> data = new Reader(new File("data.txt")).data;
public static void main(String[] args) {
List<String> left;
List<String> right;
int tot = 0;
int in = 0;
for (int i = 0; i < data.size(); i+=3) {
left = Arrays.asList(data.get(i).split(""));
right = Arrays.asList(data.get(i+1).split(""));
int indicatorleft = 0;
int indicatorright = 0;
while (true) {
in++;
if (Objects.equals(left.get(indicatorleft), "]") && Objects.equals(right.get(indicatorright),"]")) {
indicatorleft++;
indicatorright++;
continue;
} else if (Objects.equals(left.get(indicatorleft), "]")) {
} else {
if ((Integer.parseInt(left.get(indicatorleft)) <= Integer.parseInt(right.get(indicatorright)))) {
indicatorleft++;
indicatorright++;
continue;
} else {
break;
}
}
}
}
}
}
//not done yet