DEV Community

Discussion on: Daily Challenge #298 - Find the Shortest Word

Collapse
 
lizard profile image
Lizard

Here is an answer in python

def find_short(s: str) -> int:
    """
    Returns the length of the shortest word in the string s
    """
    lengths = map(lambda w: len(w), s.split())
    return min(lengths)
Enter fullscreen mode Exit fullscreen mode