#C2389. Permutation Check
Permutation Check
Permutation Check
Given two strings s1 and s2, determine if one string is a permutation of the other. Two strings are said to be permutations of each other if they consist of the same characters with the same frequency, regardless of order. Formally, two strings are permutations if they satisfy the condition:
$$|s1| = |s2| \quad \text{and} \quad \mathrm{sort}(s1) = \mathrm{sort}(s2)$$
The input consists of two lines, each representing a string. Your task is to verify whether the two strings are permutations of each other and output either True
or False
accordingly.
inputFormat
The input is given via standard input and consists of exactly two lines. The first line contains the string s1 and the second line contains the string s2. These strings may include spaces and special characters.
outputFormat
Output a single line to standard output containing either True
if the two input strings are permutations of each other, or False
if they are not.
abc
bca
True