feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 72f7833c6c
commit a1a4eeaed7
134 changed files with 2075 additions and 0 deletions

View File

@@ -9,6 +9,28 @@ categories:
patterns:
- binary-search
function_signature: "def my_pow(x: float, n: int) -> float:"
test_cases:
visible:
- input: { x: 2.0, n: 10 }
expected: 1024.0
- input: { x: 2.1, n: 3 }
expected: 9.261
- input: { x: 2.0, n: -2 }
expected: 0.25
hidden:
- input: { x: 1.0, n: 0 }
expected: 1.0
- input: { x: 5.0, n: 0 }
expected: 1.0
- input: { x: 2.0, n: 1 }
expected: 2.0
- input: { x: 2.0, n: -1 }
expected: 0.5
- input: { x: 0.5, n: 2 }
expected: 0.25
description: |
Implement `pow(x, n)`, which calculates `x` raised to the power `n` (i.e., x<sup>n</sup>).