Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
two versions solution in Clear category for Sum Numbers by rossras
def sum_numbers(text: str) -> int:
return sum(int(w) for w in text.split() if w.isdigit())
# faster to run but (IMO) slower to read
def sum_numbers(text: str) -> int:
return sum(map(int, filter(str.isdigit, text.split())))
March 14, 2020