Spaces:
Running
Running
Commit ·
61eccf3
1
Parent(s): ceba2ab
final testing...
Browse files- server/tasks/task_hard.py +4 -4
- server/tasks/task_medium.py +5 -5
server/tasks/task_hard.py
CHANGED
|
@@ -515,9 +515,9 @@ def merge_intervals(intervals):
|
|
| 515 |
""",
|
| 516 |
"explanation_keywords": ["merged[-1][1]", "end", "start", "overlap", "last interval", "index 1 vs 0"],
|
| 517 |
"test_cases": [
|
| 518 |
-
{"input": [[1, 3], [2, 6], [8, 10]], "expected": [[1, 6], [8, 10]]},
|
| 519 |
-
{"input": [[1, 4], [4, 5]], "expected": [[1, 5]]},
|
| 520 |
-
{"input": [[1, 2]], "expected": [[1, 2]]},
|
| 521 |
],
|
| 522 |
"test_cases_description": "Merge intervals: compare start with merged[-1][1] (end), not [0] (start)",
|
| 523 |
},
|
|
@@ -625,4 +625,4 @@ def get_task_by_id(task_id: str) -> dict:
|
|
| 625 |
for t in HARD_TASKS:
|
| 626 |
if t["task_id"] == task_id:
|
| 627 |
return t.copy()
|
| 628 |
-
return random.choice(HARD_TASKS).copy()
|
|
|
|
| 515 |
""",
|
| 516 |
"explanation_keywords": ["merged[-1][1]", "end", "start", "overlap", "last interval", "index 1 vs 0"],
|
| 517 |
"test_cases": [
|
| 518 |
+
{"input": [[[1, 3], [2, 6], [8, 10]]], "expected": [[1, 6], [8, 10]]},
|
| 519 |
+
{"input": [[[1, 4], [4, 5]]], "expected": [[1, 5]]},
|
| 520 |
+
{"input": [[[1, 2]]], "expected": [[1, 2]]},
|
| 521 |
],
|
| 522 |
"test_cases_description": "Merge intervals: compare start with merged[-1][1] (end), not [0] (start)",
|
| 523 |
},
|
|
|
|
| 625 |
for t in HARD_TASKS:
|
| 626 |
if t["task_id"] == task_id:
|
| 627 |
return t.copy()
|
| 628 |
+
return random.choice(HARD_TASKS).copy()
|
server/tasks/task_medium.py
CHANGED
|
@@ -93,9 +93,9 @@ def flatten(lists):
|
|
| 93 |
return result
|
| 94 |
""",
|
| 95 |
"test_cases": [
|
| 96 |
-
{"input": [[1, 2], [3, 4]], "expected": [1, 2, 3, 4]},
|
| 97 |
-
{"input": [[1]], "expected": [1]},
|
| 98 |
-
{"input": [[], [5, 6]], "expected": [5, 6]},
|
| 99 |
],
|
| 100 |
"test_cases_description": "Flattens nested lists correctly without slicing off first element",
|
| 101 |
},
|
|
@@ -452,7 +452,7 @@ def find_pairs(nums, target):
|
|
| 452 |
""",
|
| 453 |
"test_cases": [
|
| 454 |
{"input": [[2, 7, 11, 15], 9], "expected": [(2, 7)]},
|
| 455 |
-
{"input": [[1, 2, 3, 4], 5], "expected": [(
|
| 456 |
{"input": [[1, 2], 10], "expected": []},
|
| 457 |
],
|
| 458 |
"test_cases_description": "Finds all pairs summing to target using complement = target - n",
|
|
@@ -504,4 +504,4 @@ def get_task_by_id(task_id: str) -> dict:
|
|
| 504 |
for t in MEDIUM_TASKS:
|
| 505 |
if t["task_id"] == task_id:
|
| 506 |
return t.copy()
|
| 507 |
-
return random.choice(MEDIUM_TASKS).copy()
|
|
|
|
| 93 |
return result
|
| 94 |
""",
|
| 95 |
"test_cases": [
|
| 96 |
+
{"input": [[[1, 2], [3, 4]]], "expected": [1, 2, 3, 4]},
|
| 97 |
+
{"input": [[[1]]], "expected": [1]},
|
| 98 |
+
{"input": [[[], [5, 6]]], "expected": [5, 6]},
|
| 99 |
],
|
| 100 |
"test_cases_description": "Flattens nested lists correctly without slicing off first element",
|
| 101 |
},
|
|
|
|
| 452 |
""",
|
| 453 |
"test_cases": [
|
| 454 |
{"input": [[2, 7, 11, 15], 9], "expected": [(2, 7)]},
|
| 455 |
+
{"input": [[1, 2, 3, 4], 5], "expected": [(2, 3), (1, 4)]},
|
| 456 |
{"input": [[1, 2], 10], "expected": []},
|
| 457 |
],
|
| 458 |
"test_cases_description": "Finds all pairs summing to target using complement = target - n",
|
|
|
|
| 504 |
for t in MEDIUM_TASKS:
|
| 505 |
if t["task_id"] == task_id:
|
| 506 |
return t.copy()
|
| 507 |
+
return random.choice(MEDIUM_TASKS).copy()
|