Error: The type of the expression must be an array type but it resolved to String

import java.io.;
import java.util.
;
public class Cards
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int T=sc.nextInt();
while(T!=0)
{
String str,str1;
int c=0;
str= sc.next();
char[] charstr=str.toCharArray();
for(int i=0; i<5; i++)
{
str1=sc.next();
char[] charstr1=str1.toCharArray();
if((str[0]==str1[0]) || (str[1]==str1[1]))
c++;
}
if(c>0)
System.out.println(“YES”);
else
System.out.println(“NO”);
T–;
}
}
}

I’m getting some syntax error in IF condition part