Write a program that solves a linear equation ax = b in integers. Given two integers a and b (a may be zero), return a single integer value as a string if it exists and return no solution or many solutions otherwise.linear_eq(int, int) -> str
linear_eq(int, int) -> str
Example function calls:
>>> linear_eq(1, -2)
-2
>>> linear_eq(2, -1)
no solution
>>> linear_eq(1, -2)
-2
>>> linear_eq(2, -1)
no solution
Extra inforamtionThere are values for a and b where it does not matter what x is. The equation will always be satisfiedThere are vaules for a and b where x cannot be an integer
Reviews
There are no reviews yet.