`= x^2 - 2x + 1 - y^2 + 2y - 1`
`= (x-1)^2 - (y-1)^2`
`= (x-y)(x+y-2)`
\(x^2-y^2-2x+2y\)
\(\Leftrightarrow\left(x^2-y^2\right)-2.\left(x-y\right)\)
\(\Leftrightarrow\left(x-y\right).\left(x+y\right)-2.\left(x-y\right)\)
\(\Leftrightarrow\left(x-y\right).\left(x+y-2\right)\)