Getting the error
no matching function for call to 'begin(int [n])'
I am using vectors and array and set but can't find out the reason for the error.
P.S. - I googled it but also couldn't find out anything relevant.
I tried debugging it but couldn't do it.
Here's my code! 
#include<bits/stdc++.h>
using namespace std;
int main() 
{
    int t;
    scanf("%d", &t);
    while (t--)
    {
        int n, flag = 0;
        scanf("%d", &n);
        int a[n];
        for (int i = 0; i < n; i++) {
            scanf("%d", &a[i]);
        }
        int index1 = distance(begin(a), find(begin(a), end(a), 2));
        std::set<int> sa(a, a + n);
        std::vector<int> vec(sa.size());
        std::copy(sa.begin(), sa.end(), vec.begin());
        int arr[vec.size()];
        copy(vec.begin(), vec.end(), arr);
        for (int i = 0; i < vec.size(); i++) {
            for (int j = 0; j < n; j++) {
                if (arr[i] == a[j]) {
                    int index1 = distance(begin(a), find(begin(a), end(a), i));
                    int index2 = distance(begin(a), find(begin(a), end(a), j));
                    if (index1 < n && index2 < n) {
                        flag = 1;
                        break;
                    }
                }
            }
        }
        if (flag) { cout << "Truly Happy\n"; }
        else if (!flag) {
            cout << "Poor Chef\n";
        }
    }
    return 0;
}
 
    