Piyush and Magical Park

test case 1 and test case 4 are giving wrong answer .
Please help find the mistake.
#include
using namespace std;

int main() {
int r, c, s, k;
cin >> r >> c >> k >> s;
char a[100][100];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
cin >> a[i][j];
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
if (s >= 0) {
if (a[i][j] == ‘.’) {
s = s - 2;
} if (a[i][j] == ‘*’) {
s = s + 5;
} if (a[i][j] == ‘#’) {
break;
} if (j<c-1) {
s–;
}
}
}
}

if (s >= k) {
cout << “Yes” << endl << s;
} else {
cout << “No”;
}

return 0;
}

@manshalamba hey manshal you should go through video which was just upload on our youtube channel.

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.