We have to find the number of solutions to a linear equation of N variables. We have solved this using Dynamic Programming.
For the sake of simplicity, let us assume that we have to find the non-negative integral solutions for the equation, and all the coefficients on the equation are positive integers.
As an example, let us consider the linear equation 3x1 + x2 = 9. Note that this is a linear equation of 2 variables. So, here, n = 2. The non-negative integral solutions for this equation in...
Published on December 08, 2020 13:28