You get two arrays of names, invited and arrived. Return how many invited guests haven't arrived yet.
A guest may check in more than once. They still count as one guest.
Someone who wasn't invited may check in too. They don't change the answer.
Example 1:
Input: invited = ["Ava", "Leo", "Mia", "Zoe"], arrived = ["Leo", "Zoe"] Output: 2 Explanation: Leo and Zoe are here. Ava and Mia haven't arrived yet.
Example 2:
Input: invited = ["Ava", "Leo"], arrived = ["Leo", "Max", "Leo"] Output: 1 Explanation: Leo checked in twice, but he is one guest. Max wasn't invited. Only Ava is missing.
Example 3:
Input: invited = ["Sam", "Kim"], arrived = [] Output: 2 Explanation: Nobody has arrived yet.
Constraints:
invitedhas 1 to 100 names.arrivedhas 0 to 100 names.- The names in
invitedare all different. - Each name is one word of English letters, starting with a capital letter.
Free plan: 30 tutor messages. PRO is unlimited.
Saved
Ctrl + Enter to check
