benchmarks.wiki / Public workspace

CRUXEval / sample_232 / 'fssnvd', 'yes'

Problem

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

code

Code

def f(text, changes):
    result = ''
    count = 0
    changes = list(changes)
    for char in text:
        result += char if char in 'e' else changes[count % len(changes)]
        count += (1 if char not in 'e' else 0)
    return result

input

'fssnvd', 'yes'

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