79822190

Date: 2025-11-17 10:48:47
Score: 0.5
Natty:
Report link

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;
}
Reasons:
  • Blacklisted phrase (0.5): Hi there
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Нуримухаммад Гофуржонов