Check if Two Strings are Anagrams

E · easyPracticestrings

Given two strings, check if they are anagrams of each other (contain same characters same number of times).

Input
listen
silent
Output
YES
Sort both strings and compare, OR use a frequency array of size 26.
← Check if Number is PerfectCheck Leap Year →
Report an issue with this question