Language: C++

#include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <chrono>
 
typedef struct LettersInfo {
    std::string letters;
    unsigned int count;?°
} lettersInfo_s;
 
int main()
{
    std::string paramStr;
    std::getline(std::cin, paramStr);
 
    std::vector<lettersInfo_s*> lettersList;
 
    std::string letters;
    std::istringstream stream(paramStr);
 
    unsigned int maxLength = 0;
    std::string maxLengthStr;
 
    while (std::getline(stream, letters, ' ')) {
        unsigned int len = letters.size();
        if ( len != 0) {
            if ( maxLength < len ) {
                maxLengthStr = letters;
                maxLength = len;
            }

            unsigned int loopCount;
            for (loopCount = 0; loopCount < lettersList.size(); loopCount++) {
                if ( lettersList[loopCount]->letters == letters ) {
                    ++lettersList[loopCount]->count;
                    break;
                }
            }

            if (loopCount == lettersList.size()) {
                lettersInfo_s* plettersInfo = new lettersInfo_s();
                plettersInfo->letters = letters;
                ++plettersInfo->count;
                lettersList.push_back(plettersInfo);
            }
        }
    }
 
    unsigned int maxCount = 0;
    std::string maxCountStr;
    while( lettersList.size() > 0 ) {

        lettersInfo_s* plettersInfo = lettersList.erase(0);

        unsigned int count = plettersInfo->count;
        if (maxCount < count) {
            maxCountStr = plettersInfo->letters;
            maxCount = count;
        }
        delete plettersInfo;
    }
 
    std::cout << maxCountStr << " " << maxLengthStr << std::endl;
 
    return 0;
}

Compiler output:
a.cc:9:25: error: extended character ° is not valid in an identifier
    9 |     unsigned int count;?°
      |                         ^
a.cc:9:24: error: expected unqualified-id before '?' token
    9 |     unsigned int count;?°
      |                        ^
a.cc: In function 'int main()':
a.cc:54:56: error: no matching function for call to 'std::vector<LettersInfo*>::erase(int)'
   54 |         lettersInfo_s* plettersInfo = lettersList.erase(0);
      |                                       ~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = LettersInfo*; _Alloc = std::allocator<LettersInfo*>; iterator = std::vector<LettersInfo*>::iterator; const_iterator = std::vector<LettersInfo*>::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<LettersInfo*>::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = LettersInfo*; _Alloc = std::allocator<LettersInfo*>; iterator = std::vector<LettersInfo*>::iterator; const_iterator = std::vector<LettersInfo*>::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided