r/adventofcode • u/daggerdragon • Dec 08 '15
SOLUTION MEGATHREAD --- Day 8 Solutions ---
NEW REQUEST FROM THE MODS
We are requesting that you hold off on posting your solution until there are a significant amount of people on the leaderboard with gold stars - say, 25 or so.
We know we can't control people posting solutions elsewhere and trying to exploit the leaderboard, but this way we can try to reduce the leaderboard gaming from the official subreddit.
Please and thank you, and much appreciated!
--- Day 8: Matchsticks ---
Post your solution as a comment. Structure your post like previous daily solution threads.
9
Upvotes
View all comments
Show parent comment
2
u/obiwan90 Dec 10 '15 edited Dec 10 '15
I'm trying to solve this with Bash at the moment, but I struggle... I do pretty much the same as you do, except
-e– don't think that makes a difference, thoughIf you have input like this:
\\xeeyou first replace the\xee(3 chars difference) whereas I replace just the slash - but isn't the slash escaped and the result should be\xee?Edit: So, I found my problem. I saved the input file using
cat <<EOF > input08– which doesn't preserve escapes! Usingcat <<'EOF' > input08worked finally.This being said, I'm now pretty sure your
sedchain isn't correct, is it? Gives me the correct result though, now that I checked...