#2Package Manifest Verification
A warehouse receives two package manifests containing a sequence of item codes.
The warehouse system needs to determine whether the second manifest contains exactly the same items and quantities as the first manifest, even if the items appear in a different order.
Two manifests are considered equivalent if: They contain exactly the same item codes. Each item code appears the same number of times in both manifests. The order of the item codes does not matter. Uppercase and lowercase item codes are treated as different. Spaces and other characters, if present, are treated as normal item codes.
Return true if the second manifest can be formed by rearranging the items in the first manifest; otherwise, return false.
Examples
Example 1
Input: s = "A12B3"
t = "3B1A2"
Output: true
Explanation: Both strings contain exactly the same characters with the same frequencies. The characters are simply arranged in a different order.
Example 2
Input: s ="AABC"
t = "ABBC"
Output: false
Explanation: The strings do not contain the same set of characters. Therefore, one cannot be rearranged to form the other.
Example 3
Input: s = "001122"
t = "210012"
Output: true
Explanation: --
Constraints
- 1 <= s.length, t.length <= 5 * 10^4
- s and t may contain lowercase English letters, uppercase English letters, digits, spaces, and other printable characters.
- Character matching is case-sensitive.
