Compare commits
2 Commits
7a8c02dfab
...
e3435d75e2
Author | SHA1 | Date |
---|---|---|
kirbylife | e3435d75e2 | |
kirbylife | 68ccdaaadd |
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
regex="mul\(([0-9]{1,3}),([0-9]{0,3}))"
|
||||
|
||||
acc=0
|
||||
while read line; do
|
||||
if [[ $line =~ $regex ]] then
|
||||
n1=${BASH_REMATCH[1]}
|
||||
n2=${BASH_REMATCH[2]}
|
||||
acc=$(expr $n1 \* $n2 + $acc)
|
||||
fi
|
||||
done <<< $(grep -Eo $regex input.txt)
|
||||
echo $acc
|
|
@ -0,0 +1,28 @@
|
|||
# Advent of code 2024
|
||||
|
||||
Cada día en un lenguaje distinto¹.
|
||||
¹ aplica restricciones
|
||||
|
||||
- Día 1: Python
|
||||
- Día 2: Zig
|
||||
- Día 3: Bash
|
||||
|
||||
|
||||
Lenguajes por usar:
|
||||
1. ~Python~
|
||||
1. ~Zig~
|
||||
1. Golang
|
||||
1. Julia
|
||||
1. C++
|
||||
1. PHP
|
||||
1. Java
|
||||
1. Ruby
|
||||
1. Javascript
|
||||
1. LibreOffice Calc
|
||||
1. Rust
|
||||
1. Nim
|
||||
1. C#
|
||||
1. Latino
|
||||
1. D
|
||||
1. ~Bash~
|
||||
1. Crystal
|
Loading…
Reference in New Issue