I am modifying a software which is for trash collection. While reading the code, I asked myself is there any formula or trick to quickly calculate the number of time the statement gets executed inside the nested loop rather than doing it manually in head. Here's the kinda pseudo code for this----
for(i=1; i<=9;i++)
{
sum = 0;
for(j=i; j<=N && sum<=10; j++)
sum = sum + arr[j] //any quick trick to calculate it's number of execution
}