package hackerrank;

/**
 * https://www.hackerrank.com/challenges/two-strings
 */
public class TwoStrings {
    public static void main(String[] args) {
    
    }
}

@@ -14,16 +14,43 @@
 rrank;%0A%0A
+import java.util.Scanner;%0A%0A
 /**%0A * h
@@ -137,52 +137,677 @@
    p
-ublic static void main(String%5B%5D args) %7B%0A    
+rivate static String twoStrings(String a, String b) %7B%0A        char%5B%5D chars = new char%5B26%5D;%0A        for (int i = 0; i %3C a.length(); i++) %7B%0A            chars%5Ba.charAt(i) - 'a'%5D = 1;%0A        %7D%0A        for (int i = 0; i %3C b.length(); i++) %7B%0A            if (chars%5Bb.charAt(i) - 'a'%5D == 1) %7B%0A                return %22YES%22;%0A            %7D%0A        %7D%0A        return %22NO%22;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int testCases = in.nextInt();%0A        for (int t = 0; t %3C testCases; t++) %7B%0A            String a = in.next();%0A            String b = in.next();%0A            System.out.println(twoStrings(a, b));%0A        %7D
 %0A   

Solve Two Strings