diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-11-24 22:25:42 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-11-24 22:25:42 +0000 |
commit | a7a6b86002b595bc167af72606b14c67ed1bdf8f (patch) | |
tree | bff94329cf969bd9df68d3b9782fee2107db56c2 /8/solution.sh | |
download | aoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.tar.gz aoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.tar.xz aoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.zip |
init commit
Diffstat (limited to '8/solution.sh')
-rw-r--r-- | 8/solution.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/8/solution.sh b/8/solution.sh new file mode 100644 index 0000000..5b227ec --- /dev/null +++ b/8/solution.sh @@ -0,0 +1,5 @@ +rawlen=$(while read -r; do printf "${REPLY:1:-1}"; done <$1 | wc -c) +reallen=$(<$1 tr -d '\n' | wc -c) +echo $((reallen - rawlen)) +quotedlen=$(sed 's/["\\]/\\&/g;s/.*/"&"/' $1 | tr -d '\n' | wc -c) +echo $((quotedlen - reallen)) |