benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 6e81726a-ed08-5e79-9c26-8d2d42355a78

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import itertools
import math

def task_func(x):
    """
    Find the sub-sequence of a dictionary, x, with the minimum total length, where the keys are letters and the values are their lengths.

    Parameters:
    - x (dict): The dictionary of letter lengths.

    Returns:
    - list: The subsequence with the minimum total length.

    Requirements:
    - itertools
    - math

    Example:
    >>> task_func({'a': 1, 'b': 2, 'c': 3})
    ['a']
    >>> task_func({'a': 1, 'b': -2, 'c': -5, 'd': 4})
    ['b', 'c']
    """

instruct prompt

Find the sub-sequence of a dictionary, x, with the minimum total length, where the keys are letters and the values are their lengths.
The function should output with:
    list: The subsequence with the minimum total length.
You should write self-contained code starting with:

Code

import itertools
import math
def task_func(x):

code prompt

Code

import itertools
import math
def task_func(x):

entry point

task_func

libs

  • math
  • itertools

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import