• + 0 comments

    Using c#

    public static string twoStrings(string s1, string s2)
    {
      HashSet<char> hashS1 = new HashSet<char>(s1);
    
      foreach(char c in s2) {
    	if (hashS1.Contains(c)) {
    	  return "YES";
    	}
      }
      return "NO";
    }