Company: Walmart sparkplug
Difficulty: medium
Reorder With Priority A build farm keeps a queue of N pending deployment jobs. Every job carries three integers: a Priority Number (PN), a Process Number (PR), and a Process Request ID (ID). The dispatcher decides which job runs before which other job by walking through these rules, in order, until one of them breaks the tie: The job whose Priority Number has more bits set to 1 goes first. If that is a tie, the job with the numerically larger Priority Number goes first. If still tied, the job whose Process Number has more bits set to 1 goes first. If still tied, the job with the numerically larger Process Number goes first. If every one of the above matches between two jobs, only the one that appeared earlier in the input is kept for dispatch; the later duplicate is dropped entirely. Report the dispatch order as the sequence of surviving Process Request IDs, ordered exactly as the dispatcher would run them. Input Format The first line holds a single integer N, the number of queued jobs