Whats wrong in this code?

import java.util.Scanner;

class Patterntry {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int rows = scn.nextInt();
int cols = scn.nextInt();
int k = scn.nextInt();
int s = scn.nextInt();
char[][] arr = new char[rows][cols];
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
arr[i][j] = scn.next().charAt(0);
}
}
int a = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
if (arr[i][j] == β€˜.’ && j == arr[i].length - 1)
s = s - 2;
else if (arr[i][j] == β€˜β€™ && j == arr[i].length - 1)
s = s + 5;
else if (arr[i][j] == β€˜.’)
s = s - 2 - 1;
else if (arr[i][j] == '
’)
s = s + 5 - 1;
else if (arr[i][j] == β€˜#’)
j = arr[i].length - 1;
}
}
if (s > k) {
System.out.println(β€œYes”);
System.out.println(s);
} else
System.out.println(β€œNo”);

}

}

@Harsh_Sonwani bro checking it!

yes sure . do u find anything wrong

@Harsh_Sonwani Bro one issue is, its clearly written that His strength should always be greater than K while traversing or else Piyush will get lost. So this case should be handled for traversal as well as not only for last!

@Harsh_Sonwani Also unnecessary a and b variables just make changes in s or strength thats all!

I have corrected ya code.
Also mark the doubt resolved and rate!