benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 1ce15691-7c2d-5862-b6ae-7f9c63709d81

Problem

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

complete prompt

from collections import Counter
import hashlib

def task_func(word: str) -> dict:
    """
    Count the occurrence of each adjacent pair of letters from left to right in a word and encode the result as an MD5 hash.

    Parameters:
    - word (str): The word in which to count the adjacent letter pairs.

    Returns:
    - dict: A dictionary where keys are adjacent letter pairs and values are their counts.

    Requirements:
    - collections.Counter

    Examples:
    >>> task_func('abracadabra')
    'bc9af285d87b312e61ab3661e66b741b'
    >>> task_func('hello')
    'dd5dec1a853625e2dc48f3d42665c337'
    """

instruct prompt

Count the occurrence of each adjacent pair of letters from left to right in a word and encode the result as an MD5 hash.
The function should output with:
    dict: A dictionary where keys are adjacent letter pairs and values are their counts.
You should write self-contained code starting with:

Code

from collections import Counter
import hashlib
def task_func(word: str) -> dict:

code prompt

Code

from collections import Counter
import hashlib
def task_func(word: str) -> dict:

entry point

task_func

libs

  • hashlib
  • collections

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