Hi there I saw your solution and I am sure there is some errors But chek it out here is my solution I am little confused what I did in inner loop but it actually works!!!!
public static boolean hasSharedDigit (int first, int second){
int checkFirst = 0;
int checkSecond = 0;
if (first < 10 || first > 99 || second < 10 || second > 99){
return false;
}
while (first > 0){
int digit = first % 10;
checkFirst += digit;
first /= 10;
int tempSecond = second;
while (tempSecond > 0){
int digit2 = tempSecond % 10;
tempSecond/=10;
if (digit == digit2){
System.out.println("Has equal digits");
return true;
}
}
}
return false;
}