Check if two strings "listen" and "silent" are anagrams.
MediumProblem Statement
Check if two strings "listen" and "silent" are anagrams.
Sample Input
listen silent
Sample Output
Are anagrams: Yes
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <stdio.h>
#include <string.h>
int areAnagrams(char str1[], char str2[]) {
// Your code here
}
int main() {
char str1[] = "listen";
char str2[] = "silent";
printf("Are anagrams: %s\n", areAnagrams(str1, str2) ? "Yes" : "No");
return 0;
}
Input
listen silent
Expected Output
Are anagrams: Yes