Search
 
SCRIPT & CODE EXAMPLE
 

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

};
Comment

PREVIOUS NEXT
Code Example
Cpp :: pointer in return function c++ 
Cpp :: how to set a variable to infinity in c++ 
Cpp :: selection sort c++ algorithm 
Cpp :: unreal engine c++ 
Cpp :: function in struct c++ 
Cpp :: getline(cin string) not working 
Cpp :: string vector to string c++ 
Cpp :: how to play sounds in c++ 
Cpp :: card validator c++ 
Cpp :: new c++ 
Cpp :: c++ capture screen as pixel array 
Cpp :: Search Insert Position leetcode solution in cpp 
Cpp :: error handling in c++ 
Cpp :: cpp string find all occurence 
Cpp :: C++ New Lines 
Cpp :: demonstrate constructor 
Cpp :: c++ Least prime factor of numbers till n 
Cpp :: c++ exceptions 
Cpp :: vector of vectors of pairs c++ 
Cpp :: rotate an array of n elements to the right by k steps 
Cpp :: how to find even and odd numbers in c++ 
Cpp :: kmp algorithm c++ 
Cpp :: take a function as an argument in c++ 
Cpp :: c++ loop trhought object 
Cpp :: how to access a vector member by its index 
Cpp :: basic cpp 
Cpp :: how to format big numbers with commas in c++ 
Cpp :: c++ add input in 
Cpp :: c++ linked list delete node 
Cpp :: async multi thread 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =