#include <iostream>
using std::cout, std::endl, std::string;
#include <algorithm>
using std::is_permutation;
bool isAnagram(const string& firstWord, const string& secondWord){
if(firstWord.length()!=secondWord.length()){
return false;
}
return is_permutation(firstWord.begin(), firstWord.end(), secondWord.begin());
}
int main()
{
isAnagram("apprp","adppp") ? cout<<"is Anagram"<<endl: cout<<"NOT Anagram"<<endl;
return 0;
}
Code Example |
---|
Cpp :: how to reverse a vector in c++ |
Cpp :: c++ shell |
Cpp :: tuple vector c++ |
Cpp :: kmp algorithm c++ |
Cpp :: variables in c++ |
Cpp :: opencv c++ feature detection |
Cpp :: online ide c++ |
Cpp :: print in c ++ |
Cpp :: Bucket and Water Flow codechef solution in c++ |
Cpp :: c++ loop trhought object |
Cpp :: fill two dimensional array c++ |
Cpp :: oncomponentendoverlap ue4 c++ |
Cpp :: heredar constructor c++ |
Cpp :: basic cpp |
Cpp :: c++ thread wait fro 1 sec |
Cpp :: accumulate in cpp |
Cpp :: age in days in c++ |
Cpp :: c++ call by value |
Cpp :: c++ insert hashmap |
Cpp :: shortest path in unweighted graph bfs |
Cpp :: string append at position c++ |
Cpp :: round c++ |
Cpp :: priority queue in cpp |
Cpp :: insertion overloading in c++ |
Cpp :: raspberry pi mount external hard drive |
Cpp :: c++ constructor |
Cpp :: Initialize Vector Iterator with end() function |
Cpp :: progress indicator raytracer |
Cpp :: how to scan vector in c++ |
Cpp :: vector int initialize with increasing numbers |