re: Daily Challenge #18 - Triple Trouble VIEW POST

FULL DISCUSSION
 

Java:

static int tripleDouble(String a, String b) {

        for (String item : a.split("")) {
            int triple = Integer.valueOf(item) * 3;
            int doubl = Integer.valueOf(item) * 2;

            if (a.contains(String.valueOf(triple))) {
                if (b.contains(String.valueOf(doubl))) return 1;
            } else return 0;
        }
        return 0;
    }
code of conduct - report abuse