Dear student
A surjection from a set A of size n to a set B of size k may be characterized by a partition of A into k subsets, together with an permutation of the k elements of B.
The partitions are counted by the Stirling numbers of the second kind S(n,k), and the permutations are counted by k!, so there are
In this case n=4,k=4
and from table for stirling numbers S(4,4)=1
In this case, that’s S(4,4)4!=1⋅24=24.
Regards