Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
   }

};
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #Anagram #solution
ADD COMMENT
Topic
Name
3+6 =