I couldn't solve the problem, but I came to know the answer is $22$.
Then I tried to check the numbers in factorial will be cancelled by their modulo inverses w.r.t $23$. But they didn't. \begin{array}{|c|c|} \hline \text{Number} & \text{Modulo Inverse w.r.t 23} \\ \hline 2 & 1 \\ 3 & 2 \\ 4 & 3 \\ 5 & 2 \\ 6 & 5 \\ 7 & 4 \\ 8 & 7 \\ 9 & 2 \\ 10 & 7 \\ 11 & 1 \\ 12 & 11 \\ 13 & 4 \\ 14 & 11 \\ 15 & 2 \\ 16 & 7 \\ 17 & 3 \\ 18 & 11 \\ 19 & 5 \\ 20 & 7 \\ 21 & 11 \\ 22 & 1 \\ \hline \end{array}
How to solve this problem?
Wilson's theorem states that if $p$ is prime, then
$$(p-1)! \equiv -1 \pmod p$$
Note that $23$ is a prime, hence $22! \equiv 22 \pmod{23}$.