Given a 2-D array X and integer n, select the rows of X that contain only integers and sum to n (interpretable as draws from a multinomial with n degrees). Return the selected rows.
X
n
solve(...)