This commit is contained in:
2021-09-18 10:59:09 -07:00
parent fc4cacf492
commit d32ece8e9d
4 changed files with 60 additions and 22 deletions

View File

@ -1,10 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
#include "input.h"
#include "advent_utility.h"
void advent2015day05(void) {
char *input = get_input("input/2015/05");
printf("Solution for Day 05 of 2015 is not completed yet\n");
free(input);
/* Sometimes, grep really is the best tool */
char *p1 = capture_system(
"grep -E \"(.*[aeiou]){3}\" ./input/2015/05 | grep \"\\(.\\)\\1\" | egrep -v \"(ab|cd|pq|xy)\" | wc -l");
char *p2 = capture_system("grep \"\\(..\\).*\\1\" ./input/2015/05 | grep \"\\(.\\).\\1\" | wc -l");
printf("%s%s", p1, p2);
free(p1);
free(p2);
}