sir my three of the test case is getting wrong ,plz clarify…
package chall_Strings;
import java.util.*;
public class piyushAndMagicalPark {
static Scanner s=new Scanner(System.in);
public static void main(String[] args) {
int row=s.nextInt();
int col=s.nextInt();
int min=s.nextInt();
int str=s.nextInt();
char[][] arr=new char[row][col];
for(int i=0 ;i<row ;i++) {
for(int j=0 ;j<col ;j++) {
arr[i][j] =s.next().charAt(0);
}
}
for(int i=0 ;i <row ;i++) {
for(int j=0 ;j <col ;j++) {
char ch=arr[i][j];
if( j == (col -1)) {
if(ch == ‘*’) {
str =str+5;
}else if(ch == ‘.’) {
str =str-2;
}else {
break;
}
}else {
if(ch == '*'){
str = str-1;
str=str + 5;
}else if( ch == '.') {
str=str-1;
str = str-2;
}else {
break;
}
}
}
}
if(str > min) {
System.out.print(“Yes”+"\n" +str);
}else {
System.out.print(“No”);
}
}
}
this is my code