Hello, here is my code :
Why it is giving me error ?
Hello, here is my code :
Why it is giving me error ?
Why do I need to initialize max with 0?
Then it may start with any garbage value , maybe infinity 
//if giving segmentation then declare them dynamically
And What does it mean ?
But I have initialized it with inc[0] + dec[0] -1 ?
Oh missed that ,then ignore that change 
Max array size inside function is close to 10^6 , so sometimes when u create array of that size inside function then it may give segmentation error because u run out of memory in stack
Hence we have to declare the arrays dynamically in that case