2 testcases are passwed but one is giving wrong answer please help
package Challenges;
import java.util.Scanner;
public class Piyushandmagicalprank {
static Scanner scan=new Scanner(System.in);
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int rows=scan.nextInt();
int columns=scan.nextInt();
int k=scan.nextInt();
int s=scan.nextInt();
char [][] array=new char[rows][];
for(int row=0;row<array.length;row++)
{
array[row]=new char[columns];
for(int column=0;column<array[row].length;column++)
{
array[row][column]=scan.next().charAt(0);
}
}
if(rows<=100&&columns<=100&&k<=100&&s<=100)
{
addstrength(array,k,s);
}
}
public static void addstrength(char[][] array ,int k,int s)
{
for(int i=0;i<array.length;i++)
{
for(int j=0;j<array[i].length;j++)
{
char ch=array[i][j];
if(ch=='*')
{
s=s+5;
if(j<array[i].length-1)
{
s=s-1;
}
}
else if(ch=='.')
{
s=s-2;
if(j<array[i].length-1)
{
s=s-1;
}
}
else if(ch=='#')
{
break;
}
}
}
if(s>5)
{
System.out.println("Yes");
System.out.println(s);
}
else
{
System.out.println("No");
}
}
}