Challenge 2: Build a Mini Leaderboard — Possible Solution ==================================================================== 127.0.0.1:6379> ZADD game:leaderboard 300 "player1" 750 "player2" 500 "player3" (integer) 3 127.0.0.1:6379> ZREVRANGE game:leaderboard 0 -1 WITHSCORES 1) "player2" 2) "750" 3) "player3" 4) "500" 5) "player1" 6) "300" WHY THIS WORKS AS AN ANSWER ------------------------------ ZADD adds all three players and their scores in a single command, returning 3 for the three new members added. ZREVRANGE game:leaderboard 0 -1 WITHSCORES reads the sorted set in DESCENDING score order (highest first) — the standard leaderboard read, as opposed to plain ZRANGE, which would return them ascending (lowest first, the wrong order for a "who's winning" leaderboard). 0 -1 means "the whole set," the same indexing convention as LRANGE for lists. WITHSCORES includes each member's actual score alongside its name in the output, rather than just the bare ranking. The result correctly shows player2 (750) first, then player3 (500), then player1 (300) — highest score to lowest, regardless of the order they were added in the ZADD command.