@@ -0,0 +1,1225 @@
+//https://www.hackerrank.com/challenges/two-strings%0Aimport java.io.*;%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) throws IOException%7B%0A        StringBuffer sb = new StringBuffer();%0A        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A        %0A        //For each test case%0A        for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A            %0A            //Get strings%0A            final char%5B%5D A = br.readLine().toCharArray();%0A            final char%5B%5D B = br.readLine().toCharArray();%0A            %0A            //Check if both strings share a common substring%0A            sb.append(hasSubstring(A, B) ? %22YES%5Cn%22 : %22NO%5Cn%22);%0A        %7D%0A        System.out.print(sb);%0A    %7D%0A    %0A    private static boolean hasSubstring(final char%5B%5D A, final char%5B%5D B)%7B%0A        %0A        //Get presence of letters in string A%0A        int bitsA = 0;%0A        for(int i = 0, n = A.length; i %3C n; bitsA %7C= 1 %3C%3C (A%5Bi++%5D - 'a'))%7B%7D%0A        %0A        //Get presence of letters in string B%0A        int bitsB = 0;%0A        for(int i = 0, n = B.length; i %3C n; bitsB %7C= 1 %3C%3C (B%5Bi++%5D - 'a'))%7B%7D%0A        %0A        //Check if both strings have any letters in common%0A        return (bitsA & bitsB) != 0;%0A    %7D%0A%7D%0A

Create two-strings.java