Language: C++

#include <bits/stdc++.h>
using namespace std;
    

int main(){
    int ans=0,sum=0;
    int n,m;
    char c;
    string s;
    cin >>s;
    map<char &,int> data;

    for (int i = 0; i < s.length(); i++){
        data[s[i]]++;
    }

    for (auto p:data){
        c=p.first;
        if(p.second==0)break;
    }
    
    


    //cout <<fixed<<setprecision(16)<< << endl;
    cout << c << endl;

    //if(flag==1)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h: In instantiation of 'class std::map<char&, int>':
a.cc:11:21:   required from here
   11 |     map<char &,int> data;
      |                     ^~~~
/usr/include/c++/14/bits/stl_map.h:524:7: error: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >; mapped_type = int; key_type = char&]' cannot be overloaded with 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >; mapped_type = int; key_type = char&]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note: previous declaration 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >; mapped_type = int; key_type = char&]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:739:9: error: 'template<class ... _Args> std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Val>, std::_Select1st<std::pair<const _Key, _Val> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::try_emplace(key_type&&, _Args&& ...) [with _Args = {_Args ...}; _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]' cannot be overloaded with 'template<class ... _Args> std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Val>, std::_Select1st<std::pair<const _Key, _Val> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::try_emplace(const key_type&, _Args&& ...) [with _Args = {_Args ...}; _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]'
  739 |         try_emplace(key_type&& __k, _Args&&... __args)
      |         ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:722:9: note: previous declaration 'template<class ... _Args> std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Val>, std::_Select1st<std::pair<const _Key, _Val> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::try_emplace(const key_type&, _Args&& ...) [with _Args = {_Args ...}; _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]'
  722 |         try_emplace(const key_type& __k, _Args&&... __args)
      |         ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:801:9: error: 'template<class ... _Args> std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::try_emplace(const_iterator, key_type&&, _Args&& ...) [with _Args = {_Args ...}; _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]' cannot be overloaded with 'template<class ... _Args> std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::try_emplace(const_iterator, const key_type&, _Args&& ...) [with _Args = {_Args ...}; _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]'
  801 |         try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
      |         ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:782:9: note: previous declaration 'template<class ... _Args> std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::try_emplace(const_iterator, const key_type&, _Args&& ...) [with _Args = {_Args ...}; _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]'
  782 |         try_emplace(const_iterator __hint, const key_type& __k,
      |         ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:985:9: error: 'template<class _Obj> std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Val>, std::_Select1st<std::pair<const _Key, _Val> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert_or_assign(key_type&&, _Obj&&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]' cannot be overloaded with 'template<class _Obj> std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Val>, std::_Select1st<std::pair<const _Key, _Val> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert_or_assign(const key_type&, _Obj&&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]'
  985 |         insert_or_assign(key_type&& __k, _Obj&& __obj)
      |         ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:967:9: note: previous declaration 'template<class _Obj> std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Val>, std::_Select1st<std::pair<const _Key, _Val> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert_or_assign(const key_type&, _Obj&&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]'
  967 |         insert_or_assign(const key_type& __k, _Obj&& __obj)
      |         ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:1043:9: error: 'template<class _Obj> std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert_or_assign(const_iterator, key_type&&, _Obj&&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]' cannot be overloaded with 'template<class _Obj> std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert_or_assign(const_iterator, const key_type&, _Obj&&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]'
 1043 |         insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
      |         ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:1022:9: note: previous declaration 'template<class _Obj> std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert_or_assign(const_iterator, const key_type&, _Obj&&) [with _Key = char&; _Tp = int; _Compare = std::less<char&>; _Alloc = std::allocator<std::pair<char&, int> >]'
 1022 |         insert_or_assign(const_iterator __hint,
      |         ^~~~~~~~~~~~~~~~