Doubt doubt doubt

Problem in my code…???
( Getting wrong answers )

https://ide.codingblocks.com/s/611790 Problem in my code…??? ( Getting wrong answers )

https://ide.codingblocks.com/s/611827 refer this…

is quesiton ke liye jo formula hint video me h vo galat h…((j-i+1)*(j-i+2))/2…??? Also we are supposed to take mod with (10^9+1)…what about that…???

is quesiton ke liye jo formula hint video me h vo galat h…((j-i+1)*(j-i+2))/2…??? Also we are supposed to take mod with (10^9+1)…what about that…???

hi… so yes formula is this ((j-i+1)*(j-i))/2 only… and ya u have to take mod also… just saw that it was written in ques…

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.