# LC2931 Maximum Spending After Buying Items
Practice note for coding interviews.
Always buy the cheapest currently available end-of-queue item across m shops; simulate with a min-heap of shop pointers.
Time complexity is typically linear or n log n after compression; mention edge cases (empty input, all equal, single element) in the interview.
I used [AI coding interview assistant](https://www.linkjob.ai/coding-interview-copilot/) while rehearsing this pattern aloud.
Disclosure: personal study notes mentioning a practice tool.