Solve $123x \equiv 321\pmod{777}$
$\gcd(123,777) = 3$ so solution exists. Then $123x = 321 + 777k$.
$$41x = 107 + 259k\implies 41x \equiv 107\pmod{259} $$
What i need to do next?
Solve $123x \equiv 321\pmod{777}$
$\gcd(123,777) = 3$ so solution exists. Then $123x = 321 + 777k$.
$$41x = 107 + 259k\implies 41x \equiv 107\pmod{259} $$
What i need to do next?
You need to solve the Diophantine equation $$41x+259k=107$$ Note that I have made the sign positive to make the calculations easier. This is allowed as $k$ is an integer.
Now use the Euclidean Algorithm:
$$259=6\cdot41+13\\41=3\cdot13+2\\13=6\cdot2+1$$ and you can work back to solve for $x$ and $k$.