Question
You have n people (n even) and an n x n symmetric boolean matrix compatible where compatible[i][j] is 1 if person i and j can be paired. Count the number of ways to partition ALL people into n/2 compatible pairs (each person in exactly one pair). Two partitions are the same if they use the same set of pairs. Return the count. 2 <= n <= 14, n even, compatible[i][i]=0.
count_perfect_matchings(compatible: list[list[int]]) → int[[[0,1],[1,0]]]out1State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.