#C12436. Check Permutations

    ID: 41863 Type: Default 1000ms 256MiB

Check Permutations

Check Permutations

Given two strings, determine whether one string is a permutation of the other. Two strings are considered permutations if they contain the same characters with the same frequencies, possibly in a different order. For example, abc and bca are permutations, but abc and abz are not. In mathematical terms, if we denote a string by \(s\), two strings \(s_1\) and \(s_2\) are permutations if and only if \(|s_1| = |s_2|\) and after sorting each string, \(s_1 = s_2\).

inputFormat

The input consists of two lines read from standard input. The first line is the first string, and the second line is the second string.

outputFormat

Print "True" if the two strings are permutations of each other, and "False" otherwise. The output should be written to standard output.## sample

abc
bca
True