462. Ransom Note
EasyCounting
Print YES if the ransom note can be built from the magazine's letters (each letter used at most once), else NO.
Input format
Line 1: note Line 2: magazine
Output format
YES or NO
Example 1
Input
a b
Output
NO
Example 2
Input
aa ab
Output
NO
Constraints
1 ≤ lengths ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.
Loading the MyLoginn IDE…