execugraph-internal30 / internal30.jsonl
anonymousreview111's picture
Add ExecuGraph internal-30 benchmark (anonymized for double-blind review)
08f2c3e verified
{"id": "fib", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "Return the n-th Fibonacci number where fib(0)=0, fib(1)=1. Implement a function fib(n: int) -> int. Use O(n) time and O(1) space.", "primary_function": "fib", "signature_aliases": ["fibonacci", "fib_n"], "selection_rationale": "Canonical DP recurrence; tests base cases and iterative form.", "timeout_s": 5.0, "tests": [{"args": "[0]", "expected": "0", "call": null, "description": "n=0 base case", "kind": "deterministic", "has_custom_judge": false}, {"args": "[1]", "expected": "1", "call": null, "description": "n=1 base case", "kind": "deterministic", "has_custom_judge": false}, {"args": "[10]", "expected": "55", "call": null, "description": "small", "kind": "deterministic", "has_custom_judge": false}, {"args": "[20]", "expected": "6765", "call": null, "description": "medium", "kind": "deterministic", "has_custom_judge": false}, {"args": "[30]", "expected": "832040", "call": null, "description": "large", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "climb_stairs", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "You are climbing a staircase. It takes n steps to reach the top. Each time you can climb 1 or 2 steps. Return the number of distinct ways. Implement climbStairs(n: int) -> int.", "primary_function": "climbStairs", "signature_aliases": ["climb_stairs", "count_ways", "ways_to_climb"], "selection_rationale": "Fibonacci-equivalent DP under a different name; tests recurrence recognition.", "timeout_s": 5.0, "tests": [{"args": "[1]", "expected": "1", "call": null, "description": "n=1", "kind": "deterministic", "has_custom_judge": false}, {"args": "[2]", "expected": "2", "call": null, "description": "n=2", "kind": "deterministic", "has_custom_judge": false}, {"args": "[3]", "expected": "3", "call": null, "description": "n=3", "kind": "deterministic", "has_custom_judge": false}, {"args": "[5]", "expected": "8", "call": null, "description": "n=5", "kind": "deterministic", "has_custom_judge": false}, {"args": "[10]", "expected": "89", "call": null, "description": "n=10", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "coin_change", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "Given coins (list of int) and an integer amount, return the minimum number of coins to make ``amount`` or -1 if impossible. Implement coinChange(coins, amount).", "primary_function": "coinChange", "signature_aliases": ["coin_change", "min_coins"], "selection_rationale": "Classic unbounded-knapsack DP; tests unreachable-state handling.", "timeout_s": 5.0, "tests": [{"args": "[[1, 2, 5], 11]", "expected": "3", "call": null, "description": "standard", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[2], 3]", "expected": "-1", "call": null, "description": "unreachable", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[1], 0]", "expected": "0", "call": null, "description": "amount=0", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[1, 2, 5], 100]", "expected": "20", "call": null, "description": "larger", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[186, 419, 83, 408], 6249]", "expected": "20", "call": null, "description": "non-trivial", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "lcs", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "Return the length of the longest common subsequence of two strings a and b. Implement longestCommonSubsequence(a: str, b: str) -> int.", "primary_function": "longestCommonSubsequence", "signature_aliases": ["lcs", "longest_common_subsequence"], "selection_rationale": "Two-string DP; common LLM failure: confusing subsequence with substring.", "timeout_s": 5.0, "tests": [{"args": "[\"abcde\", \"ace\"]", "expected": "3", "call": null, "description": "standard", "kind": "deterministic", "has_custom_judge": false}, {"args": "[\"abc\", \"abc\"]", "expected": "3", "call": null, "description": "identical", "kind": "deterministic", "has_custom_judge": false}, {"args": "[\"abc\", \"def\"]", "expected": "0", "call": null, "description": "disjoint", "kind": "deterministic", "has_custom_judge": false}, {"args": "[\"\", \"abc\"]", "expected": "0", "call": null, "description": "empty", "kind": "deterministic", "has_custom_judge": false}, {"args": "[\"AGGTAB\", \"GXTXAYB\"]", "expected": "4", "call": null, "description": "textbook", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "house_robber", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "Given an array nums of non-negative ints, return the max sum you can collect without picking adjacent elements. Implement rob(nums: list[int]) -> int.", "primary_function": "rob", "signature_aliases": ["house_robber", "max_rob"], "selection_rationale": "1D DP with adjacency constraint; tests linear scan formulation.", "timeout_s": 5.0, "tests": [{"args": "[[1, 2, 3, 1]]", "expected": "4", "call": null, "description": "standard", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[2, 7, 9, 3, 1]]", "expected": "12", "call": null, "description": "standard", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[]]", "expected": "0", "call": null, "description": "empty", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[5]]", "expected": "5", "call": null, "description": "single", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[2, 1, 1, 2]]", "expected": "4", "call": null, "description": "adjacent equal", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "min_cost_path", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "Given an m x n grid of non-negative ints, return the minimum path sum from top-left to bottom-right moving only right or down. Implement minPathSum(grid: list[list[int]]) -> int.", "primary_function": "minPathSum", "signature_aliases": ["min_path_sum", "min_cost_path"], "selection_rationale": "2D DP on a grid; tests indexing and boundary handling.", "timeout_s": 5.0, "tests": [{"args": "[[[1, 3, 1], [1, 5, 1], [4, 2, 1]]]", "expected": "7", "call": null, "description": "standard", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 2, 3], [4, 5, 6]]]", "expected": "12", "call": null, "description": "rectangle", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[5]]]", "expected": "5", "call": null, "description": "single cell", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 2], [1, 1]]]", "expected": "3", "call": null, "description": "2x2", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]]", "expected": "9", "call": null, "description": "uniform", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "lis", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "Given an integer array nums, return the length of the longest strictly increasing subsequence. Implement lengthOfLIS(nums) -> int.", "primary_function": "lengthOfLIS", "signature_aliases": ["lis", "longest_increasing_subsequence"], "selection_rationale": "O(n log n) preferred; tests common O(n^2) baseline against optimal.", "timeout_s": 5.0, "tests": [{"args": "[[10, 9, 2, 5, 3, 7, 101, 18]]", "expected": "4", "call": null, "description": "standard", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[0, 1, 0, 3, 2, 3]]", "expected": "4", "call": null, "description": "repeats", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[7, 7, 7, 7, 7]]", "expected": "1", "call": null, "description": "all equal", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[]]", "expected": "0", "call": null, "description": "empty", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[1, 2, 3, 4, 5]]", "expected": "5", "call": null, "description": "strictly increasing", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "rod_cutting", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "Given prices[i] = price of a rod of length i+1 and an integer n, return the max obtainable revenue by cutting the rod of length n. Implement rodCutting(prices, n).", "primary_function": "rodCutting", "signature_aliases": ["rod_cutting", "max_revenue"], "selection_rationale": "Unbounded knapsack pattern with index off-by-one risk.", "timeout_s": 5.0, "tests": [{"args": "[[1, 5, 8, 9, 10, 17, 17, 20], 8]", "expected": "22", "call": null, "description": "textbook", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[3, 5, 8, 9, 10, 17, 17, 20], 8]", "expected": "24", "call": null, "description": "alt prices", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[2], 1]", "expected": "2", "call": null, "description": "single length", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[1, 5, 8, 9], 4]", "expected": "10", "call": null, "description": "small", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[1, 5, 8, 9, 10, 17, 17, 20], 1]", "expected": "1", "call": null, "description": "n=1", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "matrix_chain", "category": "dp", "source": "internal", "difficulty": "easy", "statement": "Given an array p of length n where matrix A_i has dimensions p[i-1] x p[i], return the minimum number of scalar multiplications. Implement matrixChainOrder(p: list[int]) -> int.", "primary_function": "matrixChainOrder", "signature_aliases": ["matrix_chain", "matrix_chain_order"], "selection_rationale": "Interval DP; tests nested-loop formulation.", "timeout_s": 5.0, "tests": [{"args": "[[1, 2, 3, 4]]", "expected": "18", "call": null, "description": "3 matrices", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[10, 20, 30, 40, 30]]", "expected": "30000", "call": null, "description": "textbook 1", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[10, 20, 30]]", "expected": "6000", "call": null, "description": "2 matrices", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[5, 10, 3, 12, 5, 50, 6]]", "expected": "2010", "call": null, "description": "textbook 2", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[2, 3, 4, 2, 5]]", "expected": "58", "call": null, "description": "small", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "subset_sum", "category": "dp", "source": "apps-introductory", "difficulty": "easy", "statement": "Given a list of positive ints nums and a target T, return True iff some subset of nums sums to T. Implement subsetSum(nums, target) -> bool.", "primary_function": "subsetSum", "signature_aliases": ["subset_sum", "can_partition"], "selection_rationale": "APPS-style decision DP; tests boolean DP table.", "timeout_s": 5.0, "tests": [{"args": "[[1, 2, 3, 7], 6]", "expected": "true", "call": null, "description": "standard", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[1, 2, 7, 1, 5], 10]", "expected": "true", "call": null, "description": "standard", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[1, 3, 4, 8], 6]", "expected": "false", "call": null, "description": "impossible", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[], 0]", "expected": "true", "call": null, "description": "empty target 0", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[5], 5]", "expected": "true", "call": null, "description": "single hit", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "topo_sort", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given the number of tasks N and a list of dependency pairs prerequisites where [a, b] means b must finish before a, return any valid order or [] if impossible. Implement findOrder(numCourses: int, prerequisites: list[list[int]]) -> list[int].", "primary_function": "findOrder", "signature_aliases": ["topological_sort", "course_order", "topo_sort"], "selection_rationale": "Cycle detection + topo order; common LLM failure: missing cycle check.", "timeout_s": 5.0, "tests": [{"args": "[4, [[1, 0], [2, 1], [3, 2]]]", "expected": "[0, 1, 2, 3]", "call": null, "description": "linear chain", "kind": "deterministic", "has_custom_judge": true}, {"args": "[2, [[0, 1], [1, 0]]]", "expected": "[]", "call": null, "description": "cycle", "kind": "deterministic", "has_custom_judge": true}, {"args": "[1, []]", "expected": "[0]", "call": null, "description": "single", "kind": "deterministic", "has_custom_judge": true}, {"args": "[4, [[1, 0], [2, 0], [3, 1], [3, 2]]]", "expected": "\"any valid order\"", "call": null, "description": "branching", "kind": "deterministic", "has_custom_judge": true}, {"args": "[4, [[0, 1], [1, 2], [2, 3], [3, 1]]]", "expected": "[]", "call": null, "description": "complex cycle", "kind": "deterministic", "has_custom_judge": true}]}
{"id": "cycle_detect", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given an undirected graph as an adjacency list adj (list of list of int), return True iff it contains a cycle. Implement hasCycle(adj: list[list[int]]) -> bool.", "primary_function": "hasCycle", "signature_aliases": ["has_cycle", "detect_cycle"], "selection_rationale": "Undirected cycle detection (parent-tracking DFS).", "timeout_s": 5.0, "tests": [{"args": "[[[1], [0, 2], [1]]]", "expected": "false", "call": null, "description": "path", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 2], [0, 2], [0, 1]]]", "expected": "true", "call": null, "description": "triangle", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[]]]", "expected": "false", "call": null, "description": "single", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1], [0], [3], [2]]]", "expected": "false", "call": null, "description": "two paths", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 3], [0, 2], [1, 3], [2, 0]]]", "expected": "true", "call": null, "description": "square", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "bfs", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given an adjacency list adj and a start node s, return the BFS visit order from s (ties broken by neighbour list order). Implement bfs(adj: list[list[int]], s: int) -> list[int].", "primary_function": "bfs", "signature_aliases": ["breadth_first_search"], "selection_rationale": "BFS basics; tests queue usage and visited set.", "timeout_s": 5.0, "tests": [{"args": "[[[1, 2], [0, 3], [0], [1]], 0]", "expected": "[0, 1, 2, 3]", "call": null, "description": "tree", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[]], 0]", "expected": "[0]", "call": null, "description": "single", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1], [0]], 0]", "expected": "[0, 1]", "call": null, "description": "edge", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 2], [0, 2], [0, 1]], 0]", "expected": "[0, 1, 2]", "call": null, "description": "triangle", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[], [], []], 1]", "expected": "[1]", "call": null, "description": "isolated", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "dfs", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given an adjacency list adj and a start node s, return the DFS preorder visit order (recursive, neighbour order respected). Implement dfs(adj: list[list[int]], s: int) -> list[int].", "primary_function": "dfs", "signature_aliases": ["depth_first_search"], "selection_rationale": "DFS basics; tests recursion + visited.", "timeout_s": 5.0, "tests": [{"args": "[[[1, 2], [0, 3], [0], [1]], 0]", "expected": "[0, 1, 3, 2]", "call": null, "description": "tree", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[]], 0]", "expected": "[0]", "call": null, "description": "single", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1], [0]], 0]", "expected": "[0, 1]", "call": null, "description": "edge", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 2], [0, 2], [0, 1]], 0]", "expected": "[0, 1, 2]", "call": null, "description": "triangle", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[2], [], [0]], 1]", "expected": "[1]", "call": null, "description": "isolated start", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "dijkstra", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given a weighted graph as adj where adj[u] = list of (v, w), and a source s, return a list dist of length n with shortest distances from s (use float('inf') for unreachable). Implement dijkstra(adj: list[list[tuple[int, int]]], s: int) -> list[float].", "primary_function": "dijkstra", "signature_aliases": ["shortest_path", "single_source_shortest"], "selection_rationale": "Priority queue + relaxation; common LLM failure: missing heap usage.", "timeout_s": 5.0, "tests": [{"args": "[[[[1, 4], [2, 1]], [[2, 2], [3, 5]], [[1, 2], [3, 8]], []], 0]", "expected": "[0, 3, 1, 8]", "call": null, "description": "textbook", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[]], 0]", "expected": "[0]", "call": null, "description": "single", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[[1, 1]], []], 0]", "expected": "[0, 1]", "call": null, "description": "edge", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[[1, 5]], [[2, 5]], []], 0]", "expected": "[0, 5, 10]", "call": null, "description": "line", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[[1, 1], [2, 4]], [[2, 2]], []], 0]", "expected": "[0, 1, 3]", "call": null, "description": "relax", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "bellman_ford", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given n nodes and a list of weighted edges (u, v, w) (directed), return shortest distances from source s, or None if a negative cycle is reachable. Implement bellmanFord(n, edges, s) -> list | None.", "primary_function": "bellmanFord", "signature_aliases": ["bellman_ford"], "selection_rationale": "Tests negative-cycle detection.", "timeout_s": 5.0, "tests": [{"args": "[3, [[0, 1, 1], [1, 2, 2], [0, 2, 5]], 0]", "expected": "[0, 1, 3]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[3, [[0, 1, 1], [1, 2, -1], [2, 0, -1]], 0]", "expected": "null", "call": null, "description": "neg cycle", "kind": "deterministic", "has_custom_judge": false}, {"args": "[2, [[0, 1, 4]], 0]", "expected": "[0, 4]", "call": null, "description": "single edge", "kind": "deterministic", "has_custom_judge": false}, {"args": "[1, [], 0]", "expected": "[0]", "call": null, "description": "single node", "kind": "deterministic", "has_custom_judge": false}, {"args": "[4, [[0, 1, 1], [1, 2, 1], [2, 3, 1]], 0]", "expected": "[0, 1, 2, 3]", "call": null, "description": "line", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "connected_components", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given an adjacency list adj of an undirected graph, return the number of connected components. Implement countComponents(adj) -> int.", "primary_function": "countComponents", "signature_aliases": ["count_components", "connected_components"], "selection_rationale": "Tests union-find or DFS sweep.", "timeout_s": 5.0, "tests": [{"args": "[[[1], [0], [3], [2]]]", "expected": "2", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[]]]", "expected": "1", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[], [], []]]", "expected": "3", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 2], [0, 2], [0, 1]]]", "expected": "1", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1], [0], [], [4], [3]]]", "expected": "3", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "scc", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given a directed graph as adjacency list adj, return the number of strongly connected components. Implement countSCC(adj) -> int.", "primary_function": "countSCC", "signature_aliases": ["count_scc", "strongly_connected_components"], "selection_rationale": "Kosaraju / Tarjan; tests two-pass DFS.", "timeout_s": 5.0, "tests": [{"args": "[[[1], [2], [0]]]", "expected": "1", "call": null, "description": "single SCC", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1], [], []]]", "expected": "3", "call": null, "description": "path 3", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1], [0]]]", "expected": "1", "call": null, "description": "cycle 2", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1], [2], [0], [4], [5], [3]]]", "expected": "2", "call": null, "description": "two cycles", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[]]]", "expected": "1", "call": null, "description": "single", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "unweighted_shortest", "category": "graph", "source": "internal", "difficulty": "easy", "statement": "Given an adjacency list adj and source s, return shortest hop counts from s. Use -1 for unreachable. Implement shortestHops(adj, s) -> list[int].", "primary_function": "shortestHops", "signature_aliases": ["shortest_hops", "bfs_distances"], "selection_rationale": "Tests BFS distance variant.", "timeout_s": 5.0, "tests": [{"args": "[[[1], [0, 2], [1, 3], [2]], 0]", "expected": "[0, 1, 2, 3]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[]], 0]", "expected": "[0]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1], [0], []], 0]", "expected": "[0, 1, -1]", "call": null, "description": "unreachable", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[1, 2], [0], [0]], 0]", "expected": "[0, 1, 1]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[], [], []], 1]", "expected": "[-1, 0, -1]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "grid_shortest_path", "category": "graph", "source": "apps-introductory", "difficulty": "easy", "statement": "Given an m x n binary grid where 0 is passable and 1 is a wall, return the length of the shortest path from (0,0) to (m-1,n-1) using 4-neighbour moves, or -1 if unreachable. Implement shortestPath(grid) -> int.", "primary_function": "shortestPath", "signature_aliases": ["shortest_path_grid"], "selection_rationale": "APPS-style grid BFS; tests boundary + visited.", "timeout_s": 5.0, "tests": [{"args": "[[[0, 0, 0], [1, 1, 0], [0, 0, 0]]]", "expected": "5", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[0]]]", "expected": "1", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[0, 1], [1, 0]]]", "expected": "-1", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[0, 0], [0, 0]]]", "expected": "3", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[[[0, 0, 0, 0], [1, 1, 1, 0], [0, 0, 0, 0], [0, 1, 1, 1]]]", "expected": "7", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "lru_cache", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Implement an LRU cache class LRUCache with __init__(self, capacity: int), get(key) -> int (returns -1 if absent), and put(key, value). Capacity is a positive int.", "primary_function": "LRUCache", "signature_aliases": [], "selection_rationale": "Class with O(1) get/put; common LLM failure: incorrect eviction.", "timeout_s": 5.0, "tests": [{"args": "[]", "expected": "[[null, null, 1, null, -1, null, -1, 3, 4]]", "call": "[(lambda c: ([c.put(1,1), c.put(2,2), c.get(1), c.put(3,3), c.get(2), c.put(4,4), c.get(1), c.get(3), c.get(4)]))(LRUCache(2))]", "description": "textbook", "kind": "deterministic", "has_custom_judge": false}, {"args": "[]", "expected": "[[null, \"a\"]]", "call": "[(lambda c: ([c.put(1,'a'), c.get(1)]))(LRUCache(1))]", "description": "capacity 1", "kind": "deterministic", "has_custom_judge": false}, {"args": "[]", "expected": "[[null, null, 1, null, -1]]", "call": "[(lambda c: ([c.put(1,1), c.put(2,2), c.get(1), c.put(3,3), c.get(2)]))(LRUCache(2))]", "description": "evict", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "min_stack", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Implement a stack class MinStack supporting push(x), pop(), top(), getMin() all in O(1).", "primary_function": "MinStack", "signature_aliases": [], "selection_rationale": "Tests auxiliary-stack pattern.", "timeout_s": 5.0, "tests": [{"args": "[]", "expected": "[[null, null, null, -3, null, 0, -2]]", "call": "[(lambda s: ([s.push(-2), s.push(0), s.push(-3), s.getMin(), s.pop(), s.top(), s.getMin()]))(MinStack())]", "description": "textbook", "kind": "deterministic", "has_custom_judge": false}, {"args": "[]", "expected": "[[null, null, 1, null, 1]]", "call": "[(lambda s: ([s.push(1), s.push(2), s.getMin(), s.pop(), s.getMin()]))(MinStack())]", "description": "ascending", "kind": "deterministic", "has_custom_judge": false}, {"args": "[]", "expected": "[[null, null, null, 1, null, 1]]", "call": "[(lambda s: ([s.push(3), s.push(1), s.push(1), s.getMin(), s.pop(), s.getMin()]))(MinStack())]", "description": "duplicates", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "stack_using_queue", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Implement class MyStack with push(x), pop(), top(), empty() using only queues.", "primary_function": "MyStack", "signature_aliases": [], "selection_rationale": "Tests queue-based simulation of stack semantics.", "timeout_s": 5.0, "tests": [{"args": "[]", "expected": "[[null, null, 2, 2, false]]", "call": "[(lambda s: ([s.push(1), s.push(2), s.top(), s.pop(), s.empty()]))(MyStack())]", "description": "basic", "kind": "deterministic", "has_custom_judge": false}, {"args": "[]", "expected": "[[null, 1, true]]", "call": "[(lambda s: ([s.push(1), s.pop(), s.empty()]))(MyStack())]", "description": "single", "kind": "deterministic", "has_custom_judge": false}, {"args": "[]", "expected": "[[null, null, null, 3, 2]]", "call": "[(lambda s: ([s.push(1), s.push(2), s.push(3), s.pop(), s.top()]))(MyStack())]", "description": "three elems", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "reverse_linked_list", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Define class ListNode(self, val=0, next=None) and a function reverseList(head: ListNode | None) -> ListNode | None that reverses the list. Also provide a helper to_list(head) -> list[int] that materializes a linked list.", "primary_function": "reverseList", "signature_aliases": ["reverse_list"], "selection_rationale": "Tests pointer-rewiring; LLM failure: lost head pointer.", "timeout_s": 5.0, "tests": [{"args": "[]", "expected": "[[], [1], [3, 2, 1]]", "call": "(lambda: ([to_list(reverseList(None)),to_list(reverseList(ListNode(1))),to_list(reverseList(ListNode(1, ListNode(2, ListNode(3))))),]))()", "description": "three cases", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "binary_tree_traversal", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Define class TreeNode(self, val=0, left=None, right=None) and a function inorder(root) -> list[int] that returns the inorder traversal.", "primary_function": "inorder", "signature_aliases": [], "selection_rationale": "Tests recursive traversal.", "timeout_s": 5.0, "tests": [{"args": "[]", "expected": "[[], [1], [2, 1, 3]]", "call": "(lambda: (inorder(None),inorder(TreeNode(1)),inorder(TreeNode(1, TreeNode(2), TreeNode(3)))))()", "description": "three trees", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "priority_queue", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Implement class PQ with push(x), pop() -> smallest, top() -> smallest, empty().", "primary_function": "PQ", "signature_aliases": [], "selection_rationale": "Min-heap semantics.", "timeout_s": 5.0, "tests": [{"args": "[]", "expected": "[null, null, null, 1, 1, 2, false]", "call": "(lambda q: ([q.push(3), q.push(1), q.push(2), q.top(), q.pop(), q.pop(), q.empty()]))(PQ())", "description": "basic", "kind": "deterministic", "has_custom_judge": false}, {"args": "[]", "expected": "true", "call": "(lambda q: q.empty())(PQ())", "description": "empty", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "heapify", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Implement heapify(arr: list[int]) -> None that converts arr into a min-heap in-place.", "primary_function": "heapify", "signature_aliases": ["build_heap"], "selection_rationale": "Tests in-place heap construction.", "timeout_s": 5.0, "tests": [{"args": "[]", "expected": "[null, true]", "call": "(lambda a: (heapify(a), a == sorted(a) or all(a[i] <= a[2*i+1] for i in range(len(a)) if 2*i+1 < len(a)) and all(a[i] <= a[2*i+2] for i in range(len(a)) if 2*i+2 < len(a))))([4,1,3,2,16,9,10,14,8,7])", "description": "textbook", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "avl", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Implement class AVL with insert(key) and inorder() -> list[int] that returns the sorted keys after insertions while maintaining AVL balance.", "primary_function": "AVL", "signature_aliases": [], "selection_rationale": "Balanced BST; tests rotation correctness.", "timeout_s": 5.0, "tests": [{"args": "[]", "expected": "[10, 20, 25, 30, 40, 50]", "call": "(lambda t: ([t.insert(k) for k in [10,20,30,40,50,25]] and t.inorder()))(AVL())", "description": "balanced inorder", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "adj_list_construct", "category": "ds", "source": "internal", "difficulty": "easy", "statement": "Given n vertices and a list of undirected edges, return an adjacency list (list of sorted neighbour lists). Implement adjList(n, edges).", "primary_function": "adjList", "signature_aliases": ["adjacency_list"], "selection_rationale": "Tests data-structure assembly.", "timeout_s": 5.0, "tests": [{"args": "[3, [[0, 1], [0, 2]]]", "expected": "[[1, 2], [0], [0]]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[1, []]", "expected": "[[]]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[2, [[0, 1]]]", "expected": "[[1], [0]]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[4, [[0, 1], [2, 3]]]", "expected": "[[1], [0], [3], [2]]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[3, [[0, 1], [1, 2], [0, 2]]]", "expected": "[[1, 2], [0, 2], [0, 1]]", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}]}
{"id": "valid_parentheses", "category": "ds", "source": "apps-introductory", "difficulty": "easy", "statement": "Given a string of '()[]{}', return True iff brackets close in correct order. Implement isValid(s: str) -> bool.", "primary_function": "isValid", "signature_aliases": ["is_valid", "valid_parentheses"], "selection_rationale": "APPS-style stack; classic textbook.", "timeout_s": 5.0, "tests": [{"args": "[\"()\"]", "expected": "true", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[\"()[]{}\"]", "expected": "true", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[\"(]\"]", "expected": "false", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[\"\"]", "expected": "true", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}, {"args": "[\"([)]\"]", "expected": "false", "call": null, "description": "", "kind": "deterministic", "has_custom_judge": false}]}