Skip to content

Commit

Permalink
Add mystery function questions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-d-zhang committed Feb 24, 2024
1 parent b812a71 commit 45b7743
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bot/resources/fun/trivia_quiz.json
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,16 @@
"id": 546,
"question": "What is the max value of `hash(x)` if `x` is an `int` on 32-bit machines?",
"answer": ["2^31 - 2", "2^31-2", "2**31 - 2", "2**31-2"]
},
{
"id": 547,
"question": "What common operation does this function implement?\n```py\nimport math\n\ndef mystery(x: float) -> float:\n return math.copysign(abs(x) + 2**52 - 2**52, x)\n```",
"answer": "round"
},
{
"id": 548,
"question": "What common operation does this function implement?\n```py\ndef mystery(n: int) -> int:\n return (n>>1<<1)^n\n```",
"answer": "is odd"
}
]
}

0 comments on commit 45b7743

Please sign in to comment.