Check if Two Strings are Anagrams
E · easyPracticestrings
Problem
Given two strings, check if they are anagrams of each other (contain same characters same number of times).
Example
Input
listen silent
Output
YES
Sort both strings and compare, OR use a frequency array of size 26.