Saving Princess Peach
InterviewTime limit1sMemory limit1024 MB
Given N obstacles and Mario's list of finds with repeats, print the numbers he missed in increasing order, then the count of distinct obstacles he found.
- Level
Easy2 of 10
- Topics
- Array, Implementation
- Solved
- No attempts yet
Problem
Mario is trying to save his beloved Princess Peach. To do that, he must jump over many obstacles. So he makes a grand plan to infiltrate Bowser's castle.
First, he needs to practice. His brother Luigi builds a practice course for him. On this course, Mario looks for every obstacle that could take his life. But Mario is sloppy. He misses some obstacles, counts some of them more than once, and lists the ones he finds in a jumbled order.
Write a program that tells Luigi which obstacles Mario missed.
Input
The first line contains two integers () and (). is the total number of obstacles, numbered . is the number of obstacles Mario says he found.
Each of the next lines contains one integer (), the number of an obstacle Mario says he found.
Output
Print the obstacles Mario missed in increasing order, one per line. On the last line, print Mario got X of the dangerous obstacles. where is the number of distinct obstacles Mario found.