data_source
stringclasses
1 value
prompt
listlengths
1
1
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an m x n matrix, return all elements of the matrix in spiral order.\n\n \nExample 1...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"spiral-matrix\", \"difficulty\": \"Medium\", \"entry_point\": \"spiralOrder\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected...
{ "index": "mercury_0", "split": "eval", "slug_name": "spiral-matrix", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 14 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a sorted unique integer array nums.\n\nA range [a,b] is the set of all inte...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"summary-ranges\", \"difficulty\": \"Easy\", \"entry_point\": \"summaryRanges\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expecte...
{ "index": "mercury_1", "split": "eval", "slug_name": "summary-ranges", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 15 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two strings s and t, return the number of distinct subsequences of s which equals t...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"distinct-subsequences\", \"difficulty\": \"Hard\", \"entry_point\": \"numDistinct\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, ex...
{ "index": "mercury_2", "split": "eval", "slug_name": "distinct-subsequences", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 30 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an unsorted integer array nums, return the smallest missing positive integer.\n\nYo...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"first-missing-positive\", \"difficulty\": \"Hard\", \"entry_point\": \"firstMissingPositive\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, o...
{ "index": "mercury_3", "split": "eval", "slug_name": "first-missing-positive", "difficulty": "Hard", "n_test_cases": 18, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe set [1, 2, 3, ..., n] contains a total of n! unique permutations.\n\nBy listing and l...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"permutation-sequence\", \"difficulty\": \"Hard\", \"entry_point\": \"getPermutation\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, ...
{ "index": "mercury_4", "split": "eval", "slug_name": "permutation-sequence", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a 1-indexed array of integers numbers that is already sorted in non-decreasing orde...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"two-sum-ii-input-array-is-sorted\", \"difficulty\": \"Medium\", \"entry_point\": \"twoSum\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, out...
{ "index": "mercury_5", "split": "eval", "slug_name": "two-sum-ii-input-array-is-sorted", "difficulty": "Medium", "n_test_cases": 8, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string num that contains only digits and an integer target, return all possibilit...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"expression-add-operators\", \"difficulty\": \"Hard\", \"entry_point\": \"addOperators\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs...
{ "index": "mercury_6", "split": "eval", "slug_name": "expression-add-operators", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 3 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given the root of a binary tree containing digits from 0 to 9 only.\n\nEach root-...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"sum-root-to-leaf-numbers\", \"difficulty\": \"Medium\", \"entry_point\": \"sumNumbers\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = lctk.binaryTree(*i...
{ "index": "mercury_7", "split": "eval", "slug_name": "sum-root-to-leaf-numbers", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 16 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a license key represented as a string s that consists of only alphanumeric ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"license-key-formatting\", \"difficulty\": \"Easy\", \"entry_point\": \"licenseKeyFormatting\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, o...
{ "index": "mercury_8", "split": "eval", "slug_name": "license-key-formatting", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 21 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are n gas stations along a circular route, where the amount of gas at the ith stati...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"gas-station\", \"difficulty\": \"Medium\", \"entry_point\": \"canCompleteCircuit\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, exp...
{ "index": "mercury_9", "split": "eval", "slug_name": "gas-station", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 25 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given n balloons, indexed from 0 to n - 1. Each balloon is painted with a number ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"burst-balloons\", \"difficulty\": \"Hard\", \"entry_point\": \"maxCoins\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\...
{ "index": "mercury_10", "split": "eval", "slug_name": "burst-balloons", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 26 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a large integer represented as an integer array digits, where each digits[i...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"plus-one\", \"difficulty\": \"Easy\", \"entry_point\": \"plusOne\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n if...
{ "index": "mercury_11", "split": "eval", "slug_name": "plus-one", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 14 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an input string s and a pattern p, implement regular expression matching with suppo...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"regular-expression-matching\", \"difficulty\": \"Hard\", \"entry_point\": \"isMatch\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, ...
{ "index": "mercury_12", "split": "eval", "slug_name": "regular-expression-matching", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two integer arrays nums1 and nums2 of lengths m and n respectively. nums1 a...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"create-maximum-number\", \"difficulty\": \"Hard\", \"entry_point\": \"maxNumber\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expe...
{ "index": "mercury_13", "split": "eval", "slug_name": "create-maximum-number", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 14 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA perfect number is a positive integer that is equal to the sum of its positive divisors,...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"perfect-number\", \"difficulty\": \"Easy\", \"entry_point\": \"checkPerfectNumber\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, ex...
{ "index": "mercury_14", "split": "eval", "slug_name": "perfect-number", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 15 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequen...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"fibonacci-number\", \"difficulty\": \"Easy\", \"entry_point\": \"fib\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n ...
{ "index": "mercury_15", "split": "eval", "slug_name": "fibonacci-number", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 25 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe demons had captured the princess and imprisoned her in the bottom-right corner of a d...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"dungeon-game\", \"difficulty\": \"Hard\", \"entry_point\": \"calculateMinimumHP\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expe...
{ "index": "mercury_16", "split": "eval", "slug_name": "dungeon-game", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe distance of a pair of integers a and b is defined as the absolute difference between ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"find-k-th-smallest-pair-distance\", \"difficulty\": \"Hard\", \"entry_point\": \"smallestDistancePair\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline...
{ "index": "mercury_17", "split": "eval", "slug_name": "find-k-th-smallest-pair-distance", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 19 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s, return the number of segments in the string.\n\nA segment is defined to...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"number-of-segments-in-a-string\", \"difficulty\": \"Easy\", \"entry_point\": \"countSegments\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, ...
{ "index": "mercury_18", "split": "eval", "slug_name": "number-of-segments-in-a-string", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 9 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s, reverse only all the vowels in the string and return it.\n\nThe vowels ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"reverse-vowels-of-a-string\", \"difficulty\": \"Easy\", \"entry_point\": \"reverseVowels\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outp...
{ "index": "mercury_19", "split": "eval", "slug_name": "reverse-vowels-of-a-string", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 24 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an unsorted array of integers nums, return the length of the longest consecutive el...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"longest-consecutive-sequence\", \"difficulty\": \"Medium\", \"entry_point\": \"longestConsecutive\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inp...
{ "index": "mercury_20", "split": "eval", "slug_name": "longest-consecutive-sequence", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 23 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an array nums containing n distinct numbers in the range [0, n], return the only nu...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"missing-number\", \"difficulty\": \"Easy\", \"entry_point\": \"missingNumber\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expecte...
{ "index": "mercury_21", "split": "eval", "slug_name": "missing-number", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA transformation sequence from word beginWord to word endWord using a dictionary wordList...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"word-ladder\", \"difficulty\": \"Hard\", \"entry_point\": \"ladderLength\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\...
{ "index": "mercury_22", "split": "eval", "slug_name": "word-ladder", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 23 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two binary strings a and b, return their sum as a binary string.\n\n \nExample 1:\n...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"add-binary\", \"difficulty\": \"Easy\", \"entry_point\": \"addBinary\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n ...
{ "index": "mercury_23", "split": "eval", "slug_name": "add-binary", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 10 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an array of integers nums sorted in non-decreasing order, find the starting and end...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"find-first-and-last-position-of-element-in-sorted-array\", \"difficulty\": \"Medium\", \"entry_point\": \"searchRange\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def ...
{ "index": "mercury_24", "split": "eval", "slug_name": "find-first-and-last-position-of-element-in-sorted-array", "difficulty": "Medium", "n_test_cases": 8, "n_solutions": 21 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer array nums sorted in non-decreasing order, remove the duplicates in-plac...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"remove-duplicates-from-sorted-array\", \"difficulty\": \"Easy\", \"entry_point\": \"removeDuplicates\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(...
{ "index": "mercury_25", "split": "eval", "slug_name": "remove-duplicates-from-sorted-array", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 13 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a 0-indexed array of integers nums of length n. You are initially positione...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"jump-game-ii\", \"difficulty\": \"Medium\", \"entry_point\": \"jump\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n ...
{ "index": "mercury_26", "split": "eval", "slug_name": "jump-game-ii", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 24 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer array prices where prices[i] is the price of a given stock on th...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"best-time-to-buy-and-sell-stock-iv\", \"difficulty\": \"Hard\", \"entry_point\": \"maxProfit\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, ...
{ "index": "mercury_27", "split": "eval", "slug_name": "best-time-to-buy-and-sell-stock-iv", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 23 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer num, return a string representing its hexadecimal representation. For ne...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"convert-a-number-to-hexadecimal\", \"difficulty\": \"Easy\", \"entry_point\": \"toHex\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs...
{ "index": "mercury_28", "split": "eval", "slug_name": "convert-a-number-to-hexadecimal", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s, find the first non-repeating character in it and return its index. If i...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"first-unique-character-in-a-string\", \"difficulty\": \"Easy\", \"entry_point\": \"firstUniqChar\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inpu...
{ "index": "mercury_29", "split": "eval", "slug_name": "first-unique-character-in-a-string", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 21 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer array nums and two integers indexDiff and valueDiff.\n\nFind a p...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"contains-duplicate-iii\", \"difficulty\": \"Hard\", \"entry_point\": \"containsNearbyAlmostDuplicate\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(...
{ "index": "mercury_30", "split": "eval", "slug_name": "contains-duplicate-iii", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 11 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an array nums with n objects colored red, white, or blue, sort them in-place so tha...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"sort-colors\", \"difficulty\": \"Medium\", \"entry_point\": \"sortColors\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\...
{ "index": "mercury_31", "split": "eval", "slug_name": "sort-colors", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a binary array nums, return the maximum number of consecutive 1's in the array.\n\n...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"max-consecutive-ones\", \"difficulty\": \"Easy\", \"entry_point\": \"findMaxConsecutiveOnes\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, o...
{ "index": "mercury_32", "split": "eval", "slug_name": "max-consecutive-ones", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 19 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the root of a complete binary tree, return the number of the nodes in the tree.\n\n...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"count-complete-tree-nodes\", \"difficulty\": \"Easy\", \"entry_point\": \"countNodes\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = lctk.binaryTree(*in...
{ "index": "mercury_33", "split": "eval", "slug_name": "count-complete-tree-nodes", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two non-negative integers, num1 and num2 represented as string, return the sum of n...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"add-strings\", \"difficulty\": \"Easy\", \"entry_point\": \"addStrings\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n...
{ "index": "mercury_34", "split": "eval", "slug_name": "add-strings", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 18 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s representing a valid expression, implement a basic calculator to evaluat...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"basic-calculator\", \"difficulty\": \"Hard\", \"entry_point\": \"calculate\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected)...
{ "index": "mercury_35", "split": "eval", "slug_name": "basic-calculator", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 22 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSuppose LeetCode will start its IPO soon. In order to sell a good price of its shares to ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"ipo\", \"difficulty\": \"Hard\", \"entry_point\": \"findMaximizedCapital\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\...
{ "index": "mercury_36", "split": "eval", "slug_name": "ipo", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 23 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s containing just the characters '(', ')', '{', '}', '[' and ']', determin...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"valid-parentheses\", \"difficulty\": \"Easy\", \"entry_point\": \"isValid\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):...
{ "index": "mercury_37", "split": "eval", "slug_name": "valid-parentheses", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 33 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA permutation of an array of integers is an arrangement of its members into a sequence or...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"next-permutation\", \"difficulty\": \"Medium\", \"entry_point\": \"nextPermutation\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, e...
{ "index": "mercury_38", "split": "eval", "slug_name": "next-permutation", "difficulty": "Medium", "n_test_cases": 8, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer array nums and an integer k, return true if there are two distinct indic...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"contains-duplicate-ii\", \"difficulty\": \"Easy\", \"entry_point\": \"containsNearbyDuplicate\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs,...
{ "index": "mercury_39", "split": "eval", "slug_name": "contains-duplicate-ii", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 22 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer array nums, return the maximum difference between two successive element...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"maximum-gap\", \"difficulty\": \"Medium\", \"entry_point\": \"maximumGap\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\...
{ "index": "mercury_40", "split": "eval", "slug_name": "maximum-gap", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 25 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values. (...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"binary-tree-level-order-traversal\", \"difficulty\": \"Medium\", \"entry_point\": \"levelOrder\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = lctk.bina...
{ "index": "mercury_41", "split": "eval", "slug_name": "binary-tree-level-order-traversal", "difficulty": "Medium", "n_test_cases": 13, "n_solutions": 13 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are n couples sitting in 2n seats arranged in a row and want to hold hands.\n\nThe ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"couples-holding-hands\", \"difficulty\": \"Hard\", \"entry_point\": \"minSwapsCouples\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs...
{ "index": "mercury_42", "split": "eval", "slug_name": "couples-holding-hands", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 18 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2.\...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"interleaving-string\", \"difficulty\": \"Medium\", \"entry_point\": \"isInterleave\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, e...
{ "index": "mercury_43", "split": "eval", "slug_name": "interleaving-string", "difficulty": "Medium", "n_test_cases": 8, "n_solutions": 22 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAssume you are an awesome parent and want to give your children some cookies. But, you sh...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"assign-cookies\", \"difficulty\": \"Easy\", \"entry_point\": \"findContentChildren\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, e...
{ "index": "mercury_44", "split": "eval", "slug_name": "assign-cookies", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 22 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an array of strings words, return the words that can be typed using letters of the ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"keyboard-row\", \"difficulty\": \"Easy\", \"entry_point\": \"findWords\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n...
{ "index": "mercury_45", "split": "eval", "slug_name": "keyboard-row", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 13 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the head of a singly linked list and two integers left and right where left <= righ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"reverse-linked-list-ii\", \"difficulty\": \"Medium\", \"entry_point\": \"reverseBetween\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = tuple([lctk.link...
{ "index": "mercury_46", "split": "eval", "slug_name": "reverse-linked-list-ii", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 16 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string s. You can convert s to a palindrome by adding characters in front...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"shortest-palindrome\", \"difficulty\": \"Hard\", \"entry_point\": \"shortestPalindrome\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, output...
{ "index": "mercury_47", "split": "eval", "slug_name": "shortest-palindrome", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 19 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two strings s and t of lengths m and n respectively, return the minimum window subs...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"minimum-window-substring\", \"difficulty\": \"Hard\", \"entry_point\": \"minWindow\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, e...
{ "index": "mercury_48", "split": "eval", "slug_name": "minimum-window-substring", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array of integers distance.\n\nYou start at the point (0, 0) on an X-Y p...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"self-crossing\", \"difficulty\": \"Hard\", \"entry_point\": \"isSelfCrossing\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expecte...
{ "index": "mercury_49", "split": "eval", "slug_name": "self-crossing", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the head of a sorted linked list, delete all duplicates such that each element appe...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"remove-duplicates-from-sorted-list\", \"difficulty\": \"Easy\", \"entry_point\": \"deleteDuplicates\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = tupl...
{ "index": "mercury_50", "split": "eval", "slug_name": "remove-duplicates-from-sorted-list", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 19 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s which consists of lowercase or uppercase letters, return the length of t...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"longest-palindrome\", \"difficulty\": \"Easy\", \"entry_point\": \"longestPalindrome\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs,...
{ "index": "mercury_51", "split": "eval", "slug_name": "longest-palindrome", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 14 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two integer arrays inorder and postorder where inorder is the inorder traversal of ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"construct-binary-tree-from-inorder-and-postorder-traversal\", \"difficulty\": \"Medium\", \"entry_point\": \"buildTree\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def...
{ "index": "mercury_52", "split": "eval", "slug_name": "construct-binary-tree-from-inorder-and-postorder-traversal", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 25 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are asked to cut off all the trees in a forest for a golf event. The forest is repres...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"cut-off-trees-for-golf-event\", \"difficulty\": \"Hard\", \"entry_point\": \"cutOffTree\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outpu...
{ "index": "mercury_53", "split": "eval", "slug_name": "cut-off-trees-for-golf-event", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 16 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a binary tree, find its minimum depth.\n\nThe minimum depth is the number of nodes ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"minimum-depth-of-binary-tree\", \"difficulty\": \"Easy\", \"entry_point\": \"minDepth\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = lctk.binaryTree(*i...
{ "index": "mercury_54", "split": "eval", "slug_name": "minimum-depth-of-binary-tree", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 29 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer array nums and two integers lower and upper, return the number of range ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"count-of-range-sum\", \"difficulty\": \"Hard\", \"entry_point\": \"countRangeSum\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, exp...
{ "index": "mercury_55", "split": "eval", "slug_name": "count-of-range-sum", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 19 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have n coins and you want to build a staircase with these coins. The staircase consis...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"arranging-coins\", \"difficulty\": \"Easy\", \"entry_point\": \"arrangeCoins\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expecte...
{ "index": "mercury_56", "split": "eval", "slug_name": "arranging-coins", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 22 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two strings a and b, return the length of the longest uncommon subsequence between ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"longest-uncommon-subsequence-i\", \"difficulty\": \"Easy\", \"entry_point\": \"findLUSlength\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, ...
{ "index": "mercury_57", "split": "eval", "slug_name": "longest-uncommon-subsequence-i", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 10 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the root of a binary tree, return the bottom-up level order traversal of its nodes'...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"binary-tree-level-order-traversal-ii\", \"difficulty\": \"Medium\", \"entry_point\": \"levelOrderBottom\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = ...
{ "index": "mercury_58", "split": "eval", "slug_name": "binary-tree-level-order-traversal-ii", "difficulty": "Medium", "n_test_cases": 8, "n_solutions": 11 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer x, return true if x is a palindrome, and false otherwise.\n\n \nExample ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"palindrome-number\", \"difficulty\": \"Easy\", \"entry_point\": \"isPalindrome\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expec...
{ "index": "mercury_59", "split": "eval", "slug_name": "palindrome-number", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA message containing letters from A-Z can be encoded into numbers using the following map...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"decode-ways\", \"difficulty\": \"Medium\", \"entry_point\": \"numDecodings\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected)...
{ "index": "mercury_60", "split": "eval", "slug_name": "decode-ways", "difficulty": "Medium", "n_test_cases": 8, "n_solutions": 15 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two strings s and t, return true if s is a subsequence of t, or false otherwise.\n\...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"is-subsequence\", \"difficulty\": \"Easy\", \"entry_point\": \"isSubsequence\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expecte...
{ "index": "mercury_61", "split": "eval", "slug_name": "is-subsequence", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 18 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAn n-bit gray code sequence is a sequence of 2n integers where:\n\n\n\tEvery integer is i...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"gray-code\", \"difficulty\": \"Medium\", \"entry_point\": \"grayCode\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n ...
{ "index": "mercury_62", "split": "eval", "slug_name": "gray-code", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are climbing a staircase. It takes n steps to reach the top.\n\nEach time you can eit...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"climbing-stairs\", \"difficulty\": \"Easy\", \"entry_point\": \"climbStairs\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected...
{ "index": "mercury_63", "split": "eval", "slug_name": "climbing-stairs", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 12 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s and a dictionary of strings wordDict, return true if s can be segmented ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"word-break\", \"difficulty\": \"Medium\", \"entry_point\": \"wordBreak\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n...
{ "index": "mercury_64", "split": "eval", "slug_name": "word-break", "difficulty": "Medium", "n_test_cases": 8, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the root of a binary tree, determine if it is a valid binary search tree (BST).\n\n...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"validate-binary-search-tree\", \"difficulty\": \"Medium\", \"entry_point\": \"isValidBST\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = lctk.binaryTree...
{ "index": "mercury_65", "split": "eval", "slug_name": "validate-binary-search-tree", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array of non-overlapping intervals intervals where intervals[i] = [start...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"insert-interval\", \"difficulty\": \"Medium\", \"entry_point\": \"insert\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\...
{ "index": "mercury_66", "split": "eval", "slug_name": "insert-interval", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 24 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s, partition s such that every substring of the partition is a palindrome....
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"palindrome-partitioning\", \"difficulty\": \"Medium\", \"entry_point\": \"partition\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, ...
{ "index": "mercury_67", "split": "eval", "slug_name": "palindrome-partitioning", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 29 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have k lists of sorted integers in non-decreasing order. Find the smallest range that...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"smallest-range-covering-elements-from-k-lists\", \"difficulty\": \"Hard\", \"entry_point\": \"smallestRange\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_o...
{ "index": "mercury_68", "split": "eval", "slug_name": "smallest-range-covering-elements-from-k-lists", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 19 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are buckets buckets of liquid, where exactly one of the buckets is poisonous. To fi...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"poor-pigs\", \"difficulty\": \"Hard\", \"entry_point\": \"poorPigs\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n ...
{ "index": "mercury_69", "split": "eval", "slug_name": "poor-pigs", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 16 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an n x n integer matrix grid where each value grid[i][j] represents the ele...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"swim-in-rising-water\", \"difficulty\": \"Hard\", \"entry_point\": \"swimInWater\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, exp...
{ "index": "mercury_70", "split": "eval", "slug_name": "swim-in-rising-water", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a robot on an m x n grid. The robot is initially located at the top-left corner ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"unique-paths\", \"difficulty\": \"Medium\", \"entry_point\": \"uniquePaths\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected)...
{ "index": "mercury_71", "split": "eval", "slug_name": "unique-paths", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two non-negative integers num1 and num2 represented as strings, return the product ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"multiply-strings\", \"difficulty\": \"Medium\", \"entry_point\": \"multiply\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected...
{ "index": "mercury_72", "split": "eval", "slug_name": "multiply-strings", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 24 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array prices where prices[i] is the price of a given stock on the ith da...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"best-time-to-buy-and-sell-stock-iii\", \"difficulty\": \"Hard\", \"entry_point\": \"maxProfit\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs,...
{ "index": "mercury_73", "split": "eval", "slug_name": "best-time-to-buy-and-sell-stock-iii", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 30 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a collection of candidate numbers (candidates) and a target number (target), find a...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"combination-sum-ii\", \"difficulty\": \"Medium\", \"entry_point\": \"combinationSum2\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs,...
{ "index": "mercury_74", "split": "eval", "slug_name": "combination-sum-ii", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 17 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe define the usage of capitals in a word to be right when one of the following cases hol...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"detect-capital\", \"difficulty\": \"Easy\", \"entry_point\": \"detectCapitalUse\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expe...
{ "index": "mercury_75", "split": "eval", "slug_name": "detect-capital", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 11 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array prices where prices[i] is the price of a given stock on the ith da...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"best-time-to-buy-and-sell-stock\", \"difficulty\": \"Easy\", \"entry_point\": \"maxProfit\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, out...
{ "index": "mercury_76", "split": "eval", "slug_name": "best-time-to-buy-and-sell-stock", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 18 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the root of a binary tree, return the inorder traversal of its nodes' values.\n\n \...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"binary-tree-inorder-traversal\", \"difficulty\": \"Easy\", \"entry_point\": \"inorderTraversal\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = tuple([lc...
{ "index": "mercury_77", "split": "eval", "slug_name": "binary-tree-inorder-traversal", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 21 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two integer arrays preorder and inorder where preorder is the preorder traversal of...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"construct-binary-tree-from-preorder-and-inorder-traversal\", \"difficulty\": \"Medium\", \"entry_point\": \"buildTree\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def ...
{ "index": "mercury_78", "split": "eval", "slug_name": "construct-binary-tree-from-preorder-and-inorder-traversal", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 25 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s that contains parentheses and letters, remove the minimum number of inva...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"remove-invalid-parentheses\", \"difficulty\": \"Hard\", \"entry_point\": \"removeInvalidParentheses\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(i...
{ "index": "mercury_79", "split": "eval", "slug_name": "remove-invalid-parentheses", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 3 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array of k linked-lists lists, each linked-list is sorted in ascending o...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"merge-k-sorted-lists\", \"difficulty\": \"Hard\", \"entry_point\": \"mergeKLists\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = tuple([[lctk.linkedList...
{ "index": "mercury_80", "split": "eval", "slug_name": "merge-k-sorted-lists", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 23 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s, partition s such that every substring of the partition is a palindrome....
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"palindrome-partitioning-ii\", \"difficulty\": \"Hard\", \"entry_point\": \"minCut\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, ex...
{ "index": "mercury_81", "split": "eval", "slug_name": "palindrome-partitioning-ii", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 26 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet f(x) be the number of zeroes at the end of x!. Recall that x! = 1 * 2 * 3 * ... * x a...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"preimage-size-of-factorial-zeroes-function\", \"difficulty\": \"Hard\", \"entry_point\": \"preimageSizeFZF\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_of...
{ "index": "mercury_82", "split": "eval", "slug_name": "preimage-size-of-factorial-zeroes-function", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 13 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a 0-indexed array of unique strings words.\n\nA palindrome pair is a pair o...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"palindrome-pairs\", \"difficulty\": \"Hard\", \"entry_point\": \"palindromePairs\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, exp...
{ "index": "mercury_83", "split": "eval", "slug_name": "palindrome-pairs", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 25 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer array nums where the elements are sorted in ascending order, convert it ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"convert-sorted-array-to-binary-search-tree\", \"difficulty\": \"Easy\", \"entry_point\": \"sortedArrayToBST\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_o...
{ "index": "mercury_84", "split": "eval", "slug_name": "convert-sorted-array-to-binary-search-tree", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 10 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA virus is spreading rapidly, and your task is to quarantine the infected area by install...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"contain-virus\", \"difficulty\": \"Hard\", \"entry_point\": \"containVirus\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected)...
{ "index": "mercury_85", "split": "eval", "slug_name": "contain-virus", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 14 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an m x n integers matrix, return the length of the longest increasing path in matri...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"longest-increasing-path-in-a-matrix\", \"difficulty\": \"Hard\", \"entry_point\": \"longestIncreasingPath\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_off...
{ "index": "mercury_86", "split": "eval", "slug_name": "longest-increasing-path-in-a-matrix", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 31 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer n, count the total number of digit 1 appearing in all non-negative integ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"number-of-digit-one\", \"difficulty\": \"Hard\", \"entry_point\": \"countDigitOne\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, ex...
{ "index": "mercury_87", "split": "eval", "slug_name": "number-of-digit-one", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 11 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string s and a dictionary of strings wordDict, add spaces in s to construct a sen...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"word-break-ii\", \"difficulty\": \"Hard\", \"entry_point\": \"wordBreak\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\...
{ "index": "mercury_88", "split": "eval", "slug_name": "word-break-ii", "difficulty": "Hard", "n_test_cases": 8, "n_solutions": 14 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the root of a binary tree, return the zigzag level order traversal of its nodes' va...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"binary-tree-zigzag-level-order-traversal\", \"difficulty\": \"Medium\", \"entry_point\": \"zigzagLevelOrder\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n input...
{ "index": "mercury_89", "split": "eval", "slug_name": "binary-tree-zigzag-level-order-traversal", "difficulty": "Medium", "n_test_cases": 8, "n_solutions": 10 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA binary watch has 4 LEDs on the top to represent the hours (0-11), and 6 LEDs on the bot...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"binary-watch\", \"difficulty\": \"Easy\", \"entry_point\": \"readBinaryWatch\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expecte...
{ "index": "mercury_90", "split": "eval", "slug_name": "binary-watch", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 9 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer numRows, return the first numRows of Pascal's triangle.\n\nIn Pascal's t...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"pascals-triangle\", \"difficulty\": \"Easy\", \"entry_point\": \"generate\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):...
{ "index": "mercury_91", "split": "eval", "slug_name": "pascals-triangle", "difficulty": "Easy", "n_test_cases": 7, "n_solutions": 15 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer n, return true if it is a power of three. Otherwise, return false.\n\nAn...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"power-of-three\", \"difficulty\": \"Easy\", \"entry_point\": \"isPowerOfThree\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expect...
{ "index": "mercury_92", "split": "eval", "slug_name": "power-of-three", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 20 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the s...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"binary-tree-maximum-path-sum\", \"difficulty\": \"Hard\", \"entry_point\": \"maxPathSum\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n inputs = lctk.binaryTree(...
{ "index": "mercury_93", "split": "eval", "slug_name": "binary-tree-maximum-path-sum", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 21 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an m x n integer matrix heightMap representing the height of each unit cell in a 2D...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"trapping-rain-water-ii\", \"difficulty\": \"Hard\", \"entry_point\": \"trapRainWater\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs,...
{ "index": "mercury_94", "split": "eval", "slug_name": "trapping-rain-water-ii", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 18 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA phrase is a palindrome if, after converting all uppercase letters into lowercase letter...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"valid-palindrome\", \"difficulty\": \"Easy\", \"entry_point\": \"isPalindrome\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expect...
{ "index": "mercury_95", "split": "eval", "slug_name": "valid-palindrome", "difficulty": "Easy", "n_test_cases": 13, "n_solutions": 24 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe median is the middle value in an ordered integer list. If the size of the list is eve...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"sliding-window-median\", \"difficulty\": \"Hard\", \"entry_point\": \"medianSlidingWindow\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, out...
{ "index": "mercury_96", "split": "eval", "slug_name": "sliding-window-median", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 21 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven the head of a linked list, rotate the list to the right by k places.\n\n \nExample ...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"rotate-list\", \"difficulty\": \"Medium\", \"entry_point\": \"rotateRight\", \"convert_offline\": \"def convert_offline(case):\\n import lctk\\n inputs, expected = case\\n return tuple([lctk.linkedList(inputs[0]...
{ "index": "mercury_97", "split": "eval", "slug_name": "rotate-list", "difficulty": "Medium", "n_test_cases": 7, "n_solutions": 14 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAn ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.\n\nG...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"ugly-number\", \"difficulty\": \"Easy\", \"entry_point\": \"isUgly\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expected):\\n ...
{ "index": "mercury_98", "split": "eval", "slug_name": "ugly-number", "difficulty": "Easy", "n_test_cases": 8, "n_solutions": 15 }
mercury
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are several squares being dropped onto the X-axis of a 2D plane.\n\nYou are given a...
code
{ "style": "rule", "extraction_method": "mercury_harness", "ground_truth": "{\"slug_name\": \"falling-squares\", \"difficulty\": \"Hard\", \"entry_point\": \"fallingSquares\", \"convert_offline\": \"def convert_offline(case):\\n return case\", \"evaluate_offline\": \"def evaluate_offline(inputs, outputs, expec...
{ "index": "mercury_99", "split": "eval", "slug_name": "falling-squares", "difficulty": "Hard", "n_test_cases": 7, "n_solutions": 12 }