when the loop runs for first time value of li=0.In the last for loop the sum statement shows pre[li-1][Bj].Wouldn’t it be an error as it is accessing pre[-1][Bj].
What will happen when array index turns -1
@sushant19_99 Yes you should prevent negative indexes in the array as it may have some unexpected results depending on the compiler. But here it is not causing any error and taking the value at that index as 0. It basically depends on the compiler.