Question 1019654
A= 123456789

B= 123456787

And your problem says

A^2-2AB+B^2

which factors to 

(A-B)(A-B)

We can see that A-B=2 above so the answer is 4.