PermCheck

PHOTO EMBED

Tue Jun 21 2022 17:36:47 GMT+0000 (Coordinated Universal Time)

Saved by @jacobsfo

 #include <algorithm>
#include <iostream>

// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;

int solution(vector<int> &A) {
    // write your code in C++14 (g++ 6.2.0)
    int n = A.size();
    std::sort(A.begin(),A.end());
    vector<int>B;
    for(int i = 1; i<=n; i++)
    {
       B.push_back(i);
    }
    if(B==A)
    {
        return 1;
    }
    return 0;
}
content_copyCOPY