implemented a solution to catvsdog based on the Hopcroft-Karp algorithm