When I compile the code below, I get an error:
"cannot find symbol - variable wayA"
Can someone please explain the reason?
private static int edit (String str1, String str2,int i, int j)
{
int len1=str1.length();
int len2 = str2.length();
if(len1==0 || len2==0)
return 0;
if(str1.charAt(0)==str2.charAt(0))
return edit(str1.substring(1),str2.substring(1),i,j);
int wayD =1+ edit
(str1.substring(1),str2,i,j);
if(len2>len1)
{
int wayA = 1+edit(str1+str2.charAt(0),str2.substring(0),i,j);
}
return Math.min(wayD,wayA);
// when i compile "cannot find symbol - variable wayA" why??
}