You can apply inclusion exclusion principle here.
Suppose P is define as Pth element of A matches with Pth element of B.
Then we have to find N(P1` P2` P3`) i.e none of the Pth element of A matches with Pth element of B
According to inclusion exclusion principle
N(P1`P2`P3`) = N - [N(P1) + N(P2) + N(P3)] + [N(P1P2) + N(P1P3) + N(P2P3)] - [N(P1P2P3)]
N = Total number of injective funtion possible..
For above case |A| = 3 and |B| = 5, So N = 5 x 4 x 3 = 60
N(P1) = Total number of injective function such that first element of A matches with first element of B.
So N(P1) = 4 x 3 = 12
For N(P2), N(P3), we are going to get same result.
N(P1P2) = Total number of injective function such that first two element of A matches with first two element of B
So N(P1P2) = 3
For N(P1P3) & N(P2P3), we are going to get same result.
N(P1P2P3) = Total number of injective function such that all three element of A matches with first three element of B
So N(P1P2P3) = 1
Therefore N(P1`P2`P3`) = 60 - [12 + 12 + 12] + [3 + 3 + 3] - [1] = 60 - 36 + 9 -1 = 32
So 32 is correct answer.