Path printing condition

when we hit the base case, we print the path. In the video, the code for path print is :

for(int i=0; i<=m; i++){
for(int j=0; j<=n; j++){
cout<<… } }

As the condition is < = row/col , won’t it print extra. Shouldn’t the loop condition be i<m or j<n and not = , because for 4 rows, it will run 0,1,2,3,4 i.e 5 times??

we passed m-1 and n-1 in the ratinmaze functin call so it ll only print 4