mirror of
https://github.com/fredrikr79/advent_of_code.git
synced 2026-04-20 00:40:42 +02:00
2025/2: parallelize nushell part 1
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env nu
|
#!/usr/bin/env nu
|
||||||
def part-1 [parsed] {
|
def part-1 [parsed] {
|
||||||
$parsed
|
$parsed
|
||||||
| each -f {
|
| par-each {
|
||||||
|row| where {|x| into string
|
|row| where {|x| into string
|
||||||
| split chars
|
| split chars
|
||||||
| take (($in | length) // 2)
|
| take (($in | length) // 2)
|
||||||
@@ -9,7 +9,7 @@ def part-1 [parsed] {
|
|||||||
| try {into int} catch {0}
|
| try {into int} catch {0}
|
||||||
| $in == $x
|
| $in == $x
|
||||||
}
|
}
|
||||||
} | math sum
|
} | flatten | math sum
|
||||||
}
|
}
|
||||||
|
|
||||||
let input = open input
|
let input = open input
|
||||||
|
|||||||
Reference in New Issue
Block a user