How many distinct functions f:{1,2}→{3,4,5} are there for specific range size.
in your case the range size is not given
here is similar example:
How many distinct functions f:{1,2,3,4,5}→{1,2,3} are there, from the set {1,2,3,4,5} to the set {1,2,3}, whose range is a set of size exactly 2?
You can choose a two element set from {1,2,3} in C(3,2)=3 ways, and for each such choice there exists 2^5 many functions. But 2 of them are constant. Thus, for each two element set of the range, there are 2^5-2 number of non constant functions. So, the total number of required functions are 3×(2^5-2)=90.