Is my code correct? As it not giving the correct sum of submatrix

#include<bits/stdc++.h>
using namespace std;

int main(){
int n,m,arr[10][10];;
cin>>n>>m;

for (int i = 0; i < n; i++)
{
    for(int j=0 ; j<m ; j++)
    {
        cin>>arr[i][j];
    }
}

// Finidng the sum of submatrix - Brut Force Approach

int sum = 0;
for (int li = 0; li < n; li++)
{
    for (int lj = 0; lj < m; lj++)
    {
        for (int bi = li+1; bi < n; bi++)
        {
            for (int bj = lj+1; bj < m; bj++)
            {
                for (int i = li; i < bi; i++)
                {
                    for (int j = lj; j < bj; j++)
                    {
                        sum += arr[i][j];        
                    }
                    
                }
                
            }
            
        }
        
    }
    
}

cout<<sum;
return 0;

}

hi @hiteshmehra809_c9f950ced91b5a1b,

in the video one thing is wrong it will bi not bi+1 same for bj

ive commented here

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.

Oh I got the point !
Thank you.