#C178. Are Permutations?
Are Permutations?
Are Permutations?
You are given two strings. Your task is to determine if the two strings are permutations of each other. Two strings are considered permutations if they have the same length and if one string can be rearranged to form the other.
For example, "listen" and "silent" are permutations of each other, while "abc" and "def" are not.
Note: The comparison is case-sensitive and takes into consideration all characters, including digits and special characters.
Mathematically, for two strings \( s_1 \) and \( s_2 \), they are permutations of each other if and only if \( |s_1| = |s_2| \) and for every character \( c \), the frequency of \( c \) in \( s_1 \) is equal to the frequency of \( c \) in \( s_2 \).
inputFormat
The input consists of exactly two lines. The first line contains the first string \( s_1 \) and the second line contains the second string \( s_2 \).
outputFormat
Output a single line containing either "True" or "False" (without quotes). Output "True" if the two strings are permutations of each other, otherwise output "False".
## samplelisten
silent
True