Question
A storefront wants bargain items shown before everything else. Given a list of item prices and a bargain limit, return the list rearranged so all prices strictly below the limit come first, followed by the rest — and within each of the two groups, the original relative order is preserved. Example: [8, 3, 10, 1, 5] with limit 6 becomes [3, 1, 5, 8, 10].
bargains_first(prices: list[int], limit: int) → list[int][[8,3,10,1,5],6]out[3,1,5,8,10]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.