In this program
When i take the input of arrays
While doing calculations
value of arrays get changed automatically
I have seen this by printing d[i] and c[i-(b-a)] individually before calculating sum in while loop
from a certain index
the value of input in c array gets changed 7 and then 6 , 5 so on
my code is this
Please tell me the fault in the code
As i have checked by dry run also
it is correct
But while compyling it automatically changes the input values
Value of input changing
hey @Ramitgoel, instead of using a and b as the size of array try using some static value say 100 or 200 and let me know if u r still facing the problem
I modified the code
as i was declaring d[b] before scanning b
but after that my code is working for 2 test cases not all
please help
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.