Ad
Code
Diff
  • interface Kumite {
      static boolean hasThree(int x) {
        return ("" + x).indexOf('3') != -1;
      }
    }
    • import java.util.Random;
    • interface Kumite {
    • static boolean hasThree(int x) {
    • var random = new Random();
    • var comp = '\0';
    • while(comp != '3') {
    • if(comp > '3') comp -= random.nextInt();
    • if(comp < '3') comp += random.nextInt();
    • }
    • var str = (x + "");
    • var hasThree = false;
    • for(int i = 0; i < str.length(); i++)
    • {
    • if(str.charAt(i) - comp == '\0') hasThree = true;
    • }
    • return hasThree;
    • return ("" + x).indexOf('3') != -1;
    • }
    • }