6 September 2026
Sticker Album
Hard
Lists
Dictionaries
Find the first draw that completes a page of needed stickers.
You are given sticker names drawn one at a time and a list of stickers needed for one album page. Read the draws from left to right. Keep track of which needed stickers have appeared. Extra stickers do not matter. Return the draw number when every needed sticker has appeared for the first time. Draw numbers start at 1. Return 0 when no stickers are needed. Return -1 when the page is not completed.
Constraints
draws contains at most 200 lowercase sticker namesneeded contains different lowercase sticker namesA sticker may appear more than once in draws
Function signature
def first_completed_page(draws, needed):