#C8356. Permutation Check

    ID: 52329 Type: Default 1000ms 256MiB

Permutation Check

Permutation Check

Given two strings, determine if one string is a permutation of the other. Two strings are permutations of each other if they have the same characters (with the same multiplicities) but possibly in a different order.

Note: The comparison is case-sensitive and whitespace counts as a character.

For example, given "abc" and "bca", the strings are permutations, but "abc" and "abcd" are not.

You may use any algorithm (such as sorting or counting) to solve this problem. Formally, two strings s1 and s2 are permutations of each other if and only if \[ |s1| = |s2| \quad \text{and} \quad \forall c \in \Sigma,\ \mathrm{count}(s1, c) = \mathrm{count}(s2, c) \]

inputFormat

The input is given from stdin and consists of two lines:

  1. The first line contains the first string.
  2. The second line contains the second string.

Note that the strings can consist of any printable characters.

outputFormat

Print to stdout a single line with either "True" if the two strings are permutations of each other, or "False" otherwise.

## sample
abc
bca
True