\(K=x^3-3xy\left(x-y\right)-x^2+2xy-y^2\left(y+1\right)\)
\(=x^3-3x^2y+3xy^2-x^2+2xy-y^3-y^2\)
\(=\left(x^3-3x^2y+3xy^2-y^3\right)-\left(x^2-2xy+y^2\right)\)
\(=\left(x-y\right)^3-\left(x-y\right)^2\)
Ta có: x - y = 7 \(\Rightarrow\left(x-y\right)^3-\left(x-y\right)^2=7^3-7^2=342-49=293\)
Vậy K = 293.