@@ -0,0 +1,1404 @@
+import java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0A%0Aimport java.util.Map;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.Map;%0Aimport java.util.Map;%0A%0A// https://www.hackerrank.com/challenges/two-strings/problem%0Apublic class TwoStrings %7B%0A%0A  private static final String YES = %22YES%22;%0A  private static final String NO = %22NO%22;%0A%0A  private static Map%3CCharacter, Boolean%3E getMap(String string) %7B%0A    Map%3CCharacter, Boolean%3E map = new HashMap();%0A    for (Character aChar : string.toCharArray()) %7B%0A      map.put(aChar, true);%0A    %7D%0A    return map;%0A  %7D%0A%0A  private static String hasSubString(String firstLine, String secondLine) %7B%0A    Map%3CCharacter, Boolean%3E chars = getMap(firstLine);%0A    for (Character aChar : secondLine.toCharArray()) %7B%0A      if (chars.getOrDefault(aChar, false)) %7B%0A        return YES;%0A      %7D%0A    %7D%0A    return NO;%0A  %7D%0A%0A  /*%0A   * s1 = %22hello%22%0A   * s2 = %22ae%22%0A   */%0A%0A  public static void main(String%5B%5D args) throws IOException %7B%0A    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) %7B%0A      int cases = Integer.parseInt(reader.readLine());%0A      while (cases %3E 0) %7B%0A        String firstLine = reader.readLine();%0A        String secondLine = reader.readLine();%0A        String hasSubString = hasSubString(firstLine, secondLine);%0A        System.out.println(hasSubString);%0A        cases--;%0A      %7D%0A    %7D%0A  %7D%0A%7D%0A

Add solution for 'Two strings' problem.