I hereby claim:
- I am ljyang on github.
- I am lj (https://keybase.io/lj) on keybase.
- I have a public key whose fingerprint is 7860 0285 E9CC C829 9106 4E11 829C 484E 0F48 3570
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Part one script | |
************************************************* | |
#!/bin/bash | |
file="day3.txt" | |
dupes="" | |
declare -i tally | |
while read -r line; do | |
linelen=${#line} | |
let linehalf=$linelen/2 | |
a=$(echo "$line" | cut -c1-$linehalf) |
part1 | |
#!/bin/bash | |
declare -i count | |
count = 0 | |
sed 's/,/ /g' day4.txt | sed 's/-/ /g' >split.txt | |
file="split.txt" | |
while read -r a1 a2 b1 b2; do | |
if [ $a1 -le $b1 -a $a2 -ge $b2 ] || [ $a1 -ge $b1 -a $a2 -le $b2 ]; | |
then | |
count+=1 |
PART2 | |
#!/bin/bash | |
input=`cat input.txt` | |
for (( c=14; c -lt $(#input); c++ )); do | |
if [ `echo ${input:((c-14)):14} | fold -w1 | sort -u | wc -l | xargs` -eq 14 ]; then | |
echo "solution is: $c" | |
break | |
fi | |
done |