Video tutorial answer is '13' but my answer is 11 pls explain me how

#include
using namespace std;
void park(char a[][100],int m, int n,int k,int s){
bool sucess = true;

for(int i=0;i<m;i++){
    for(int j=0;j<n;j++){
        char ch=a[i][j];
         if(s<k){
          sucess =false;
          break;
       }
        if (ch=='.'){
            s-=2;
        }
        else if(ch=='*'){
            s+=5;
        }
        else {
            break;
        }
        if(j!=n){
            s-=1;
        }
    }
}
if (sucess){
    cout<<"yes"<<endl;
    cout<<s;
}
else{
    cout<<"no"<<endl;
}

}
int main() {
int m,n,k,s;
cin>>m>>n>>k>>s;
char a[100][100];
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
cin>>a[i][j];
}
}
park(a,m,n,k,s);
}

this is not correct statement
correct one is

		if (j != n-1) {
			s -= 1;
		}

now your output will be 13

if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like :heart:: and don’t forgot to mark doubt as resolved :grinning:

sir I am understanding the video tutorial but when it comes to code I stuck literally don’t know how to approach the solution… pls help me out

initially you face difficulties while writing codes
keep practicing
practice makes man perfect
where you got stuck?
you have write code it’s okay

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.