Here, according to the question
if $$A=1$$, then $${ A }^{ 3 }={ 1 }$$,
We see that unit digit number of $$A$$ and $${ A }^{ 3 }$$ are same.
for, $$A=2\Rightarrow { A }^{ 3 }=8,$$, unit digits are not same
$$A=3\Rightarrow { A }^{ 3 }=27,$$ unit digits are not same
$$A=4\Rightarrow { A }^{ 3 }=64,$$ unit digits are same
$$A=5\Rightarrow { A }^{ 3 }=125,$$ unit digits are same
$$A=6\Rightarrow { A }^{ 3 }=216,$$ unit digits are not same
$$A=7\Rightarrow { A }^{ 3 }=343,$$ unit digits are not same
$$A=8\Rightarrow { A }^{ 3 }=512,$$ unit digits are not same
$$A=8\Rightarrow { A }^{ 3 }=512,$$ unit digits are same
So, there are five possible solutions where unit digits of $$A$$ and $${ A }^{ 3 }$$ are same.
$$\therefore x=5$$
Again, if we take $$A=1,{ A }^{ 2 }=1,{ A }^{ 3 }={ 1 }$$, unit digits are same
$$A=2\Rightarrow { A }^{ 2 }=4,{ A }^{ 3 }=8,$$ unit digits are not same
$$A=3\Rightarrow { A }^{ 2 }=9,{ A }^{ 3 }=27,$$ unit digits are not same
$$A=4\Rightarrow { A }^{ 2 }=16,{ A }^{ 3 }=64,$$ unit digits are not same
$$A=5\Rightarrow { A }^{ 2 }=25,{ A }^{ 3 }=125,$$ unit digits are same
$$A=6\Rightarrow { A }^{ 2 }=36,{ A }^{ 3 }=216,$$ unit digits are same
$$A=7\Rightarrow { A }^{ 2 }=49,{ A }^{ 3 }=343,$$ unit digits are not same
$$A=8\Rightarrow { A }^{ 2 }=64,{ A }^{ 3 }=512,$$ unit digits are not same
$$A=9\Rightarrow { A }^{ 2 }=81,{ A }^{ 3 }=729$$ unit digits are not same
Here, we can see that there are three possible solutions where unit digits of $${ A }^{ 2 },{ A }^{ 3 }$$ are same.
So, $$y=3$$
Hence, $$x-y=5-3=2.$$