I think the condition remaining_budget > 0 might be a bit confusing. Using remaining_budget >= 0 could make it clearer and ensure the budget isn’t exceeded. If the cumulative salary of selected candidates exactly equals the budget, remaining_budget >= 0 will include that candidate, but > 0 will not.
In this scenario, where the goal is to maximize the number of candidates, >= 0 is the better choice because it ensures no valid candidate is excluded.