even though i think my code is right i think i am facing problem in how to scan my input.
Hereβs my code:
Scanner scn= new Scanner(System.in);
int row=scn.nextInt();
int col=scn.nextInt();
int min=scn.nextInt();
int s=scn.nextInt();
for(int i=1;i<=row;i++) {
for(int j=1;j<=row;j++) {
char a=scn.nextLine().charAt(0);
scn.nextLine().charAt(0);
if(a==β*β) {s=s+5;}
else if(a==β.β) {s=s-2;}
else if(a==β#β) {break;}
}
}
if(s>min) {System.out.println("yes" +"\n" + s);}
else {System.out.println("No");}