benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 89a7a0bc-2834-54b5-9823-4711864c49ba

Problem

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

complete prompt

import random
from collections import Counter

def task_func(strings: list) -> dict:
    """
    Analyzes a given list of strings for the occurrence of a specific pattern and counts the occurrences.

    Parameters:
    - strings (list): A list of strings to be analyzed.

    Returns:
    dict: A dictionary with results of string analysis showing counts of the pattern.

    Requirements:
    - random
    - collections

    Example:
    >>> task_func(['abcd}def}', 'pqrs}tuv}', 'wxyz}123}', '456}789}', '0ab}cde}'])
    Counter({2: 10})
    """

instruct prompt

Analyzes a given list of strings for the occurrence of a specific pattern and counts the occurrences.
The function should output with:
    dict: A dictionary with results of string analysis showing counts of the pattern.
You should write self-contained code starting with:

Code

import random
from collections import Counter
def task_func(strings: list) -> dict:

code prompt

Code

import random
from collections import Counter
def task_func(strings: list) -> dict:

entry point

task_func

libs

  • collections
  • random

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