  We obtain through a Matrix Product Ansatz the exact solution of the most
general inhomogeneous spin chain with nearest neighbor interaction and with
$U(1)^2$ and $U(1)^3$ symmetries. These models are related to the one loop
mixing matrix of the Leigh-Strassler deformed N=4 SYM theory, dual to type IIB
string theory in the generalized Lunin-Maldacena backgrounds, in the sectors of
two and three kinds of fields, respectively. The solutions presented here
generalizes the results obtained by the author in a previous work for
homogeneous spins chains with $U(1)^N$ symmetries in the sectors of N=2 and
N=3.
