Language: C++

#include<iostream>
#include<string>
#include<unordered_set>
using namesapce std;

int main()
{
  string str;
  unordered_set<char> s;
  cin>>str;
  int count[4] = {0};
  
  for(int i=0;i<3;i++)
  {
    if(s.find(str[i]) == s.end())
       {
         count[i]++;
         s.insert(str[i]);
       }
    else if(str[i] == str[0])
      count[0]++;
    else
      count[1]++;
  }
  
  if(count[0] == 2 && count[1] == 2)
    cout<<"Yes\n";
  else
    cout<<"No\n";
  
  return 0;
  
}
    
    
    
  

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'namesapce'
    4 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'string' was not declared in this scope
    8 |   string str;
      |   ^~~~~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:3: error: 'unordered_set' was not declared in this scope
    9 |   unordered_set<char> s;
      |   ^~~~~~~~~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/unordered_set:41,
                 from a.cc:3:
/usr/include/c++/14/bits/unordered_set.h:104:11: note:   'std::unordered_set'
  104 |     class unordered_set
      |           ^~~~~~~~~~~~~
/usr/include/c++/14/unordered_set:65:13: note:   'std::pmr::unordered_set'
   65 |       using unordered_set
      |             ^~~~~~~~~~~~~
a.cc:9:17: error: expected primary-expression before 'char'
    9 |   unordered_set<char> s;
      |                 ^~~~
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin>>str;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:8: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   cin>>str;
      |        ^~~
      |        std
a.cc:15:8: error: 's' was not declared in this scope
   15 |     if(s.find(str[i]) == s.end())
      |        ^
a.cc:27:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |     cout<<"Yes\n";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:29:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   29 |     cout<<"No\n";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~