Determine all positive integers $n$ such that there exists a polynomial $P$ of degree $n$ with integer coefficients and $n$ distinct integers $k_{1}, k_{2}, \ldots, k_{n}$ satisfying $P\left(k_{i}\right)=n$ for all integers $1 \leqslant i \leqslant n$ and $P(0)=0$.
Let $Q(X)=P(X)-n$. Since for all indices $i$ between 1 and $n$, $Q\left(k_{i}\right)=P\left(k_{i}\right)-n=n-n=0$, $Q$ has $n$ roots and is of degree $n$. Thus there exists $c$ such that

$$
Q(X)=c\left(X-k_{1}\right)\left(X-k_{2}\right) \cdots\left(X-k_{n}\right)
$$

with $c$ an integer since $P$ has integer coefficients. On the one hand, $Q(0)=P(0)-n=-n$ and on the other hand, $Q(0)=c\left(-k_{1}\right) \cdot\left(-k_{2}\right) \cdots\left(-k_{n}\right)$. Since the $k_{i}$ are distinct and non-zero, at most two of the $k_{i}$ have an absolute value of 1, so at least $n-2$ of the $k_{i}$ have an absolute value of at least 2. Thus $\left|c\left(-k_{1}\right) \cdot\left(-k_{2}\right) \cdots\left(-k_{n}\right)\right| \geqslant 1 \cdot 1 \cdot 2 \cdots 2=2^{n-2}$. Therefore, $n \geqslant 2^{n-2}$.

Let's prove by induction that if $m \geqslant 5$ is an integer, $2^{m-2}>m$. If $m=5$, we have $2^{5-2}=8>5$. Suppose the statement is true for some $m \geqslant 5$, and we want to show that $2^{m+1-2}>m+1$. Now, $2^{m-1}=2 \cdot 2^{m-2}>2m>m+1$ using the induction hypothesis. This completes the induction.

From this discussion, we deduce that $n \leqslant 4$. If $n=1$, the polynomial $X$ satisfies the condition (with $k_{1}=1$). If $n=2$, the polynomial $(X-1)(X-2)-2$ satisfies the condition (with $k_{1}=1$ and $k_{2}=2$). If $n=3$, the polynomial $(X-1)(X+1)(X-3)-3$ satisfies the condition (with $k_{1}=1, k_{2}=-1, k_{3}=3$). Finally, if $n=4$, the polynomial $(X-1)(X+1)(X+2)(X-2)-4$ satisfies the condition (with $k_{1}=1, k_{2}=-1, k_{3}=-2, k_{4}=2$).

The solutions are therefore the integers $1, 2, 3$, and $4$.