Skip to content

Commit 5719f4c

Browse files
authored
Fix jq command to sum player scores using add
1 parent 8bdd943 commit 5719f4c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

jq/script-09.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ set -euo pipefail
77
# Your output should contain 6 lines, each with one word and one number on it.
88
# The first line should be "Ahmed 15" with no quotes.
99

10-
jq -r '.[] | [.name, (.scores | reduce .[] as $score (0; . + $score))] | join(" ")' ./scores.json
10+
jq -r '.[] | [.name, (.scores | add)] | join(" ")' ./scores.json

0 commit comments

Comments
 (0)