Skip to content

Commit 1e4a547

Browse files
committed
ci: fix reproducibility
1 parent b0cdabe commit 1e4a547

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.templates/leetcode/json/min_stack.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
},
1717
"readme_constraints": "- `-2^31 <= val <= 2^31 - 1`\n- Methods `pop`, `top` and `getMin` operations will always be called on **non-empty** stacks.\n- At most `3 * 10^4` calls will be made to `push`, `pop`, `top`, and `getMin`.",
1818
"readme_additional": "",
19-
"helpers_imports": "",
19+
"helpers_imports": "from typing import Any",
2020
"helpers_content": "",
2121
"helpers_run_name": "min_stack_operations",
2222
"helpers_run_signature": "(solution_class: type, operations: list[str], inputs: list[list[int]])",
23-
"helpers_run_body": " stack: solution_class | None = None\n results: list[int | None] = []\n for i, op in enumerate(operations):\n if op == 'MinStack':\n stack = solution_class()\n results.append(None)\n elif op == 'push' and stack is not None:\n stack.push(inputs[i][0])\n results.append(None)\n elif op == 'pop' and stack is not None:\n stack.pop()\n results.append(None)\n elif op == 'top' and stack is not None:\n results.append(stack.top())\n elif op == 'getMin' and stack is not None:\n results.append(stack.get_min())\n return results",
23+
"helpers_run_body": " stack: Any = None\n results: list[int | None] = []\n for i, op in enumerate(operations):\n if op == 'MinStack':\n stack = solution_class()\n results.append(None)\n elif op == 'push' and stack is not None:\n stack.push(inputs[i][0])\n results.append(None)\n elif op == 'pop' and stack is not None:\n stack.pop()\n results.append(None)\n elif op == 'top' and stack is not None:\n results.append(stack.top())\n elif op == 'getMin' and stack is not None:\n results.append(stack.get_min())\n return results",
2424
"helpers_assert_name": "min_stack_operations",
2525
"helpers_assert_signature": "(result: list[int | None], expected: list[int | None]) -> bool",
2626
"helpers_assert_body": " assert result == expected\n return True",

.templates/leetcode/json/time_based_key_value_store.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"helpers_content": "",
2121
"helpers_run_name": "time_map_operations",
2222
"helpers_run_signature": "(solution_class: type, operations: list[str], inputs: list[list])",
23-
"helpers_run_body": " time_map = None\n results = []\n for i, op in enumerate(operations):\n if op == 'TimeMap':\n time_map = solution_class()\n results.append(None)\n elif op == 'set' and time_map is not None:\n time_map.set(*inputs[i])\n results.append(None)\n elif op == 'get' and time_map is not None:\n results.append(time_map.get(*inputs[i]))\n return results, time_map",
23+
"helpers_run_body": " time_map = None\n results: list[str | None] = []\n for i, op in enumerate(operations):\n if op == 'TimeMap':\n time_map = solution_class()\n results.append(None)\n elif op == 'set' and time_map is not None:\n time_map.set(*inputs[i])\n results.append(None)\n elif op == 'get' and time_map is not None:\n results.append(time_map.get(*inputs[i]))\n return results, time_map",
2424
"helpers_assert_name": "time_map_operations",
2525
"helpers_assert_signature": "(result: list, expected: list) -> bool",
2626
"helpers_assert_body": " results, _ = result\n assert results == expected\n return True",

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PYTHON_VERSION = 3.13
2-
PROBLEM ?= binary_tree_right_side_view
2+
PROBLEM ?= min_stack
33
FORCE ?= 0
44
COMMA := ,
55

leetcode/min_stack/helpers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
from typing import Any
2+
3+
14
def run_min_stack_operations(solution_class: type, operations: list[str], inputs: list[list[int]]):
2-
stack = None
5+
stack: Any = None
36
results: list[int | None] = []
47
for i, op in enumerate(operations):
58
if op == "MinStack":

0 commit comments

Comments
 (0)