2015-05
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user