Determine whether every level in a game can be passed using the combined set of levels completed by two players.
Problem 469A
gfgA game has levels numbered from $1n$.
Two players each know a list of levels they can complete. If we combine the levels known by both players, can we cover every level from $1n$?
Return YES if every level appears in at least one of the two lists, otherwise return NO.
Check whether the union of the two players' level sets contains all levels from $1n$.
YES if every level from $1n$ is covered by at least one player.NO.Example 1
Input
4 3 1 2 3 2 2 4
Output
YES
Explanation
The combined levels are {1,2,3,4}, so every level is covered.
Example 2
Input
4 3 1 2 3 2 2 3
Output
NO
Explanation
Level 4 is missing from both lists, so not all levels are covered.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.