UK and US: Part 2

  • + 1 comment

    test case 5 was giving wrong answer for same reason. If I've been here earlier then I could've saved my hackos

    import re
    
    str = ' '.join([input() for _ in range(int(input()))])
    
    for _ in range(int(input())):
        print(len(re.findall(input().replace('our','ou?r')+r'\b', str)))
    
    • + 0 comments

      Nice one.