Answers for "Anagram solution in c++"

C++
0

Anagram solution in c++

class Solution
{
   public:
   //Function is to check whether two strings are anagram of each other or not.
   bool isAnagram(string a, string b){
       
       // Your code here
       sort(a.begin(),a.end());
       sort(b.begin(),b.end());
       if(a==b)
       {
           return true;
       }
       return false;
   }

};
Posted by: Guest on March-22-2022

Code answers related to "Anagram solution in c++"

Browse Popular Code Answers by Language