in a question it is given that there is a number denoted by variable total. also v are given an integer k
we need to find the number of ways in which numbers from 1 to k can sum to total
eg total = 5, k=2 i-e (1,2)
one way coul be {1,1,1,1,1}
or{1,1,1,2}
and so on…
i have submitted below code but only 2 test cases got passed
**************ways to sum
hi nisha,
I think you have given the wrong link of code, can you please provide the correct link.
hi nisha,
Sorry for the late reply.
I think your code is correct, can you provide me the question link so that i can submit it myself.
Also try increasing the size of your array from 100 to 100,000, maybe it will work.
Please let me know once you try this.
It was the question in on of the coding test… In that i have taken the size of dp array according to the constraints given… But this code has passes only 2 test cases