Day 6: Custom Customs

Functions:

solve(input_string)

Count the number of yes answers in the group given as input_string.

solve(input_string: str) int[source]

Count the number of yes answers in the group given as input_string.

Requires
  • all(
        len(set(list(line))) == len(line)
        for line in input_string.split("\n")
    )
    
  • all(
        re.match(r"^[a-z]*$", line)
        for line in input_string.split("\n")
    )
    
Ensures
  • result >= 0