2015 day5 p1 & p2
This commit is contained in:
parent
91610024c9
commit
aa1540e34d
1000
2015/5/input.txt
Normal file
1000
2015/5/input.txt
Normal file
File diff suppressed because it is too large
Load diff
11
2015/5/part1.js
Normal file
11
2015/5/part1.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const input = fs.readFileSync('input.txt', 'utf-8').split('\n');
|
||||||
|
|
||||||
|
let counter = 0;
|
||||||
|
for (let str of input) {
|
||||||
|
if ((str.match(/(a|e|i|o|u)/g) || []).length >= 3 &&
|
||||||
|
str.match(/(\w)\1/g) &&
|
||||||
|
!str.match(/(ab|cd|pq|xy)/))
|
||||||
|
counter++;
|
||||||
|
}
|
||||||
|
console.log(counter)
|
9
2015/5/part2.js
Normal file
9
2015/5/part2.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const input = fs.readFileSync('input.txt', 'utf-8').split('\n');
|
||||||
|
|
||||||
|
let counter = 0;
|
||||||
|
for (let str of input) {
|
||||||
|
if (str.match(/(\w{2}).*\1/g) && str.match(/(\w)\w\1/g))
|
||||||
|
counter++;
|
||||||
|
}
|
||||||
|
console.log(counter)
|
|
@ -2,8 +2,8 @@
|
||||||
1. [py :star: :star:](https://adventofcode.com/2015/day/1 "see puzzle")
|
1. [py :star: :star:](https://adventofcode.com/2015/day/1 "see puzzle")
|
||||||
1. [js :star: :star:](https://adventofcode.com/2015/day/2 "see puzzle")
|
1. [js :star: :star:](https://adventofcode.com/2015/day/2 "see puzzle")
|
||||||
1. [py :star: :star:](https://adventofcode.com/2015/day/3 "see puzzle")
|
1. [py :star: :star:](https://adventofcode.com/2015/day/3 "see puzzle")
|
||||||
1. [py :star: :star:](https://adventofcode.com/2015/day/5 "see puzzle")
|
1. [py :star: :star:](https://adventofcode.com/2015/day/4 "see puzzle")
|
||||||
1. ...
|
1. [js :star: :star:](https://adventofcode.com/2015/day/5 "see puzzle")
|
||||||
|
|
||||||
# Languages Used
|
# Languages Used
|
||||||
### Python
|
### Python
|
||||||
|
@ -16,3 +16,5 @@
|
||||||
1. [-](https://adventofcode.com/2015/day/1 "see puzzle")
|
1. [-](https://adventofcode.com/2015/day/1 "see puzzle")
|
||||||
1. [:star: :star:](https://adventofcode.com/2015/day/2 "see puzzle")
|
1. [:star: :star:](https://adventofcode.com/2015/day/2 "see puzzle")
|
||||||
1. [-](https://adventofcode.com/2015/day/3 "see puzzle")
|
1. [-](https://adventofcode.com/2015/day/3 "see puzzle")
|
||||||
|
1. [-](https://adventofcode.com/2015/day/3 "see puzzle")
|
||||||
|
1. [:star: :star:](https://adventofcode.com/2015/day/3 "see puzzle")
|
||||||
|
|
|
@ -13,8 +13,8 @@ if (advent) {
|
||||||
1. [py :star: :star:](https://adventofcode.com/2015/day/1 "see puzzle")
|
1. [py :star: :star:](https://adventofcode.com/2015/day/1 "see puzzle")
|
||||||
1. [js :star: :star:](https://adventofcode.com/2015/day/2 "see puzzle")
|
1. [js :star: :star:](https://adventofcode.com/2015/day/2 "see puzzle")
|
||||||
1. [py :star: :star:](https://adventofcode.com/2015/day/3 "see puzzle")
|
1. [py :star: :star:](https://adventofcode.com/2015/day/3 "see puzzle")
|
||||||
1. [py :star: :star:](https://adventofcode.com/2015/day/5 "see puzzle")
|
1. [py :star: :star:](https://adventofcode.com/2015/day/4 "see puzzle")
|
||||||
1. [-](https://adventofcode.com/2015/day/6 "see puzzle")
|
1. [js :star: :star:](https://adventofcode.com/2015/day/5 "see puzzle")
|
||||||
|
|
||||||
#### [2018](https://adventofcode.com/2018 "2018 puzzle calendar")
|
#### [2018](https://adventofcode.com/2018 "2018 puzzle calendar")
|
||||||
1. [js :star: :star:](https://adventofcode.com/2015/day/1 "see puzzle")
|
1. [js :star: :star:](https://adventofcode.com/2015/day/1 "see puzzle")
|
||||||
|
|
Loading…
Reference in a new issue