Code Room
CodingEasycod-g1206
Subject ArraysLevel Entry–Mid~10 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A picker scans items one by one, and the scans so far should match the start of the pick list exactly. Given the codes scanned so far and the full pick list, return true if the scan sequence is a prefix of the pick list — same values, same order, starting from the first entry. An empty scan log is always a valid prefix. Example: scans [12, 5] against pick list [12, 5, 9] return true.

Implement
scans_match_start(scans: list[int], picklist: list[int]) → bool
Examples
in[[12,5],[12,5,9]]outtrue
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.