Added day 4.
This commit is contained in:
parent
8ba3d25b3d
commit
31463e7a81
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,12 @@
|
|||
module s4a;
|
||||
import util;
|
||||
|
||||
void main() {
|
||||
readText("input/4.txt").strip.splitter("\n")
|
||||
.count!((line) {
|
||||
int a, b, c, d;
|
||||
formattedRead(line.strip, "%d-%d,%d-%d", a, b, c, d);
|
||||
return (a >= c && b <= d) || (c >= a && d <= b);
|
||||
})
|
||||
.writeln;
|
||||
}
|
Loading…
Reference in New Issue