Spaces:
Sleeping
Sleeping
Deploy: tasks/medium/medium-2.json
Browse files- tasks/medium/medium-2.json +12 -0
tasks/medium/medium-2.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"task_id": "medium-2",
|
| 3 |
+
"description": "Fix the factorial function with wrong base case",
|
| 4 |
+
"buggy_code": "def factorial(n):\n if n == 1:\n return 0\n return n * factorial(n - 1)\n",
|
| 5 |
+
"correct_code": "def factorial(n):\n if n == 1:\n return 1\n return n * factorial(n - 1)\n",
|
| 6 |
+
"tests": [
|
| 7 |
+
{"input": [1], "expected": 1},
|
| 8 |
+
{"input": [3], "expected": 6},
|
| 9 |
+
{"input": [5], "expected": 120},
|
| 10 |
+
{"input": [4], "expected": 24}
|
| 11 |
+
]
|
| 12 |
+
}
|