Language: C++

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

int find_num(int n, int k, vector<int> &inp) {
    set<int> num;
    if (k=2) {
        for (int i=0; i<n; i++) {
            for (int j=0; j<n; j++) {
                if (i!=j){
                    num.insert((int)(stoi(inp.at(i))+to_string(inp.at(j))));
                }
            }
        }
    }
    else if (k=3) {
        for (int i=0; i<n; i++) {
            for (int j=0; j<n; j++) {
                for (int k=0; k<n; k++) {
                    if (i!=j && j!=k && k!=i) {
                        num.insert(stoi(to_string(inp.at(i))+to_string(inp.at(j))+to_string(inp.at(k))));
                    }
                }
            }
        }
    }
    else {
        for (int i=0; i<n; i++) {
            for (int j=0; j<n; j++) {
                if (i!=j) {
                    for (int k=0; k<n; k++) {
                        if (i!=k && j!=k) {
                            for (int l=0; l<n; l++) {
                                if (i!=l && j!=l && k!=l) {
                                    num.insert(stoi(to_string(inp.at(i))+to_string(inp.at(j))+to_string(inp.at(k))+to_string(inp.at(l))));
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return set.size();
}

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> inp(n);
    for (int i=0; i<n; i++) {
        cin >> inp(i);
    }
    cout << find_num(n, k, &inp) << endl;
}

Compiler output:
a.cc: In function 'int find_num(int, int, std::__debug::vector<int>&)':
a.cc:11:42: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   11 |                     num.insert((int)(stoi(inp.at(i))+to_string(inp.at(j))));
      |                                      ~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:2:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
a.cc:44:15: error: missing template arguments before '.' token
   44 |     return set.size();
      |               ^
a.cc: In function 'int main()':
a.cc:52:19: error: no match for call to '(std::__debug::vector<int>) (int&)'
   52 |         cin >> inp(i);
      |                ~~~^~~
a.cc:54:28: error: invalid initialization of non-const reference of type 'std::__debug::vector<int>&' from an rvalue of type 'std::__debug::vector<int>*'
   54 |     cout << find_num(n, k, &inp) << endl;
      |                            ^~~~
a.cc:5:41: note: in passing argument 3 of 'int find_num(int, int, std::__debug::vector<int>&)'
    5 | int find_num(int n, int k, vector<int> &inp) {
      |                            ~~~~~~~~~~~~~^~~