MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / arePermutation

Function arePermutation

CPP/char array/arepermut.cpp:8–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#define mod 1000000007
7#define endl '\n'
8bool arePermutation(string a,string b){
9
10 int n=a.length();
11 int m=a.length();
12 if(n!=m)
13 return false;
14 sort(a.begin(),a.end());
15 sort(b.begin(),b.end());
16 for (int i = 0; i < n; i++) {
17 if(a[i]!=b[i])
18 return false;
19 }
20 return true;
21}
22
23int main(){
24 cin.tie(0)->sync_with_stdio(0);

Callers 1

mainFunction · 0.85

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected