The Question
Coding
FEFO Credit Management System
Design a resource management system (like GPU credits) that allows users to add credit packs with varying expiration dates. Implement a mechanism to consume credits such that the credits expiring soonest are used first (FEFO). The system must support adding credits, consuming a specific amount at a given timestamp, and querying the current valid balance.
Python
Heap
Priority Queue
Greedy
March 27, 2026