Dataset Viewer
Auto-converted to Parquet Duplicate
context
listlengths
1
1
gen_kwargs
dict
repeat_idx
int64
0
0
request_idx
int64
14
20
task_name
stringclasses
1 value
metadata
dict
model_outputs
stringclasses
7 values
[ { "content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given an integer array prices representing the prices of various chocolates in a store. You are also given a single integer money, which represents you...
{ "do_sample": false, "max_new_tokens": 32768, "seed": 0, "temperature": 0.7 }
0
14
LiveCodeBench
{ "expected_answer": "", "problem_id": "", "reference_solution": "" }
def minMoneyLeft(prices, money): To solve this problem, we need to find the two chocolates with the minimum prices and check if their combined price is less than or equal to the given `money`. If so, we return the leftover money after the purchase. Otherwise, we return the initial `money`. Here is the function body:...
[ { "content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given two numeric strings num1 and num2 and two integers max_sum and min_sum. We denote an integer x to be good if:\n\nnum1 <= x <= num2\nmin_sum <= di...
{ "do_sample": false, "max_new_tokens": 32768, "seed": 0, "temperature": 0.7 }
0
15
LiveCodeBench
{ "expected_answer": "", "problem_id": "", "reference_solution": "" }
def countGoodIntegers(num1: str, num2: str, min_sum: int, max_sum: int) -> int: To solve this problem, we can use a dynamic programming approach with memoization to count the number of good integers between `num1` and `num2` that satisfy the given constraints. Here's a Python function that implements this approach:...
[ { "content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed array nums of length n.\nThe distinct difference array of nums is an array diff of length n such that diff[i] is equal to the number ...
{ "do_sample": false, "max_new_tokens": 32768, "seed": 0, "temperature": 0.7 }
0
16
LiveCodeBench
{ "expected_answer": "", "problem_id": "", "reference_solution": "" }
def distinct_difference_array(nums): # Your implementation here pass def distinct_difference_array(nums): n = len(nums) prefix_counts = [0] * n suffix_counts = [0] * n prefix_unique = set() suffix_unique = set() for i in range(n): prefix_unique.add(nums[i]) prefix_c...
[ { "content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.There is a 0-indexed array nums of length n. Initially, all elements are uncolored (has a value of 0).\nYou are given a 2D integer array queries where queries[...
{ "do_sample": false, "max_new_tokens": 32768, "seed": 0, "temperature": 0.7 }
0
17
LiveCodeBench
{ "expected_answer": "", "problem_id": "", "reference_solution": "" }
def solution(n, queries): # Your implementation here pass def solution(n, queries): nums = [0] * n answer = [] for index, color in queries: nums[index] = color count = 0 for i in range(n - 1): if nums[i] == nums[i + 1] and nums[i] != 0: coun...
[ { "content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed integer array nums representing the strength of some heroes. The power of a group of heroes is defined as follows:\n\nLet i_0, i_1, ....
{ "do_sample": false, "max_new_tokens": 32768, "seed": 0, "temperature": 0.7 }
0
18
LiveCodeBench
{ "expected_answer": "", "problem_id": "", "reference_solution": "" }
Here's the function body for the given problem: ```python def sumOfPower(nums): nums.sort() result = 0 MOD = 10**9 + 7 prefix_sum = 0 for num in nums: # Calculate the power of the current number as a single group result = (result + (num**3 + num * prefix_sum) % MOD) % MOD ...
[ { "content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed permutation of n integers nums.\nA permutation is called semi-ordered if the first number equals 1 and the last number equals n. You ...
{ "do_sample": false, "max_new_tokens": 32768, "seed": 0, "temperature": 0.7 }
0
19
LiveCodeBench
{ "expected_answer": "", "problem_id": "", "reference_solution": "" }
def min_operations_to_semi_ordered(nums): n = len(nums) index1, indexn = nums.index(1), nums.index(n) # If 1 is already at the first position and n is already at the last position if index1 == 0 and indexn == n - 1: return 0 operations = 0 # Move 1 to the first position ...
[ { "content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed string s that consists of digits from 0 to 9.\nA string t is called a semi-repetitive if there is at most one consecutive pair of the...
{ "do_sample": false, "max_new_tokens": 32768, "seed": 0, "temperature": 0.7 }
0
20
LiveCodeBench
{ "expected_answer": "", "problem_id": "", "reference_solution": "" }
Here's the executable Python function based on the given prompt: ```python def longestSemiRepetitiveSubstring(s: str) -> int: n = len(s) max_len = 1 start = 0 consecutive_count = 0 for end in range(1, n): if s[end] == s[end - 1]: consecutive_count += 1 whi...
README.md exists but content is empty.
Downloads last month
13