Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

A restaurant chef processes food orders in a specific sequence. The orders are represented as an array of unique integers named orderIds. The chef processes one eligible orderId at a time and removes it from the array once it is processed.

An orderId is considered eligible if it meets the following conditions:

Test Cases
Input
Output
Expected