Description
The canonical solution for HumanEval/111 (histogram) in the HumanEval+ dataset throws a ValueError when the input string contains only spaces, which contradicts the expected behavior.
Problem
The canonical solution attempts to call max() on an empty list when all words after splitting are empty strings:
Steps to Reproduce
histogram(" ") # Single space
histogram(" ") # Multiple spaces
Expected Behavior
Ideally, the function should return an empty dictionary {} for strings containing only spaces.
Actual Behavior
ValueError: max() iterable argument is empty
Description
The canonical solution for HumanEval/111 (
histogram) in the HumanEval+ dataset throws aValueErrorwhen the input string contains only spaces, which contradicts the expected behavior.Problem
The canonical solution attempts to call
max()on an empty list when all words after splitting are empty strings:Steps to Reproduce
Expected Behavior
Ideally, the function should return an empty dictionary
{}for strings containing only spaces.Actual Behavior