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

Question

A supplier recalls specific pallets in a warehouse. You get the current unit counts per slot and a list of slot indices that were recalled. Set the count at every recalled index to 0 and return the updated list. Every index in the recall list is a valid position, and the same index may appear more than once. Example: counts [5, 3, 8] with recalls [0, 2] become [0, 3, 0].

Implement
zero_recalled(counts: list[int], recalled: list[int]) → list[int]
Examples
in[[5,3,8],[0,2]]out[0,3,0]
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.