Skip to content

Commit

Permalink
utilize the first loop variable
Browse files Browse the repository at this point in the history
  • Loading branch information
glennj committed Jul 11, 2024
1 parent 21954ee commit 0f32739
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exercises/practice/pascals-triangle/.meta/example.jq
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ # collect all the output from `foreach`
foreach range(.count) as $_ (
foreach range(.count) as $n (
[];
# that range stops at 1; range is half-inclusive
reduce range(length - 1; 0; -1) as $i (. + [1]; .[$i] += .[$i - 1])
reduce range($n - 1; 0; -1) as $i (. + [1]; .[$i] += .[$i - 1])
)
]

0 comments on commit 0f32739

Please sign in to comment.