Skip to content

Commit 9789692

Browse files
script-10 and 11 updated to map
1 parent 217ad76 commit 9789692

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

jq/script-10.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ set -euo pipefail
44

55
# The input for this script is the scores.json file.
66
# TODO: Write a command to output the total of adding together all players' first scores.
7-
jq -r '[.[].scores[0]] | add' scores.json
7+
jq 'map(.scores[0]) | add' scores.json
88

99
# Your output should be exactly the number 54.

jq/script-11.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ set -euo pipefail
44

55
# The input for this script is the scores.json file.
66
# TODO: Write a command to output the total of adding together all scores from all games from all players.
7-
jq -r '[.[].scores[]] | add' scores.json
7+
jq 'map(.scores[]) | add' scores.json
88

99
# Your output should be exactly the number 164.

0 commit comments

Comments
 (0)