How to check if a integer is sum of given integers?
- by p3trix
Lets say I have a integer result and an array of integers, lets say [a,b,c] (not a fixed length). I need to detect if result=a*i +b*j + c*k, with i,j,k=0.
I prefer a solution in C/C# if it is possible.
PS The problem is from a reservation system, a trip can be sold if its durations is a combination of given durations.
Thanks!