Horje
Anagram Code Example
anagram
def anagram(a, b):
    return True if sorted(a) == sorted(b) else False

# Based on the answer below :D
Anagram
const anagram = (str1, str2) => {
    return str1.toLowerCase().split('').sort().join('') === str2.toLowerCase().split('').sort().join('');
};

let test = anagram('Regallager', 'Lagerregal');
console.log(test);
anagram
// for 2 strings s1 and s2 to be anagrams
// both conditions should be True
// 1 their length is same or 
len(s1)==len(s2)
// 2 rearranging chars alphabetically make them equal or 
sorted(s1)==sorted(s2)




Cpp

Related
attention nlp Code Example attention nlp Code Example
find permutations Code Example find permutations Code Example
kmp c++ Code Example kmp c++ Code Example
std::array c++ Code Example std::array c++ Code Example
passing a 2d array cpp Code Example passing a 2d array cpp Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8