Suppose I am trying to fill up positions $A,B,C$ with candidates $\{1,2,3,4,5,6\}$ and each candidate can only be in one position at most. Each position has a set of candidates who have applied, for example we can say that the candidates for each position are given as follows $$ \begin{align} Can(A)&=\{1,2,3,4\} \\ Can(B)&=\{2,3,4,5\} \\ Can(C)&=\{3,4,5,6\} \end{align} $$
Clearly we can't just $4^3$ because the intersection of the positions are non-empty. Obviously, this little toy example can be brute forced pretty easily or proved by cases that you grind out, but I wanted to know if there was a better formula for this that generalized for larger cases?