Lambda functions

Theory

Anagram

Report a typo

Two words are considered anagrams if one can be formed by rearranging the letters of the other. For example, 'Silent' is an anagram of 'Listen,' as the letters of 'Listen' can be rearranged to form 'Silent'. Write a lambda function to determine if a word is anagram of another or not. The lambda function should return True if the words are anagrams and False otherwise.

Sample Input 1:

listen
silent

Sample Output 1:

Anagrams
Write a program in C++
// Lambda to check anagrams
auto checkAreAnagrams {[](std::string firstWord, std::string secondWord) -> bool { // Please don't modify this
// Your code here
}};
___

Create a free account to access the full topic