Language: C++

#include<bits/stdc++.h>
#define ll unsigned long long int 
using namespace std;
vector<string> v;

string dp[4000];
string helper(string s1,int start1, string s2, int start2)
{
    if(start1 > s1.length() )
        return "";
    
    
    else if(start2 > s2.length())
        return v;
    
    else if(s1[start1] == s2[start2] )
    {
        v.push_back(s1[start1]);
        helper(s1, start1 + 1, s2, start2 + 1);
    }
    else
    {
        helper(s1,start1, s2, start2 + 1);
    }
}
int main()
{
    memset(dp, "", sizeof dp);
    string s1, s2;
    cin >> s1;
    cin >> s2;

   cout<< helper(s1, 0, s2, 0);
}


Compiler output:
a.cc: In function 'std::string helper(std::string, int, std::string, int)':
a.cc:14:16: error: could not convert 'v' from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   14 |         return v;
      |                ^
      |                |
      |                std::vector<std::__cxx11::basic_string<char> >
a.cc:18:20: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   18 |         v.push_back(s1[start1]);
      |         ~~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc: In function 'int main()':
a.cc:28:16: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   28 |     memset(dp, "", sizeof dp);
      |                ^~
      |                |
      |                const char*
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121:
/usr/include/string.h:61:37: note:   initializing argument 2 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                 ~~~~^~~