Company: Walmart sparkplug
Difficulty: medium
Reorder With Priority John has a list of N system requests to be processed based on their priority. Each request has three fields: Priority Number (PN), Process Number (PR), and Process Request ID (ID). The system processes requests in this order: More set bits (1s) in the Priority Number. If equal, the larger Priority Number. If still equal, more set bits in the Process Number. If still equal, the larger Process Number. If all the above are equal, the request appearing first in the list is processed, and others with the same values are rejected. Your task is to return the "Reorder" which is the list of Process Request IDs in the order they are processed by the system. Input Format The first line of input contains an integer N which represents the numbers of request. The next line N contain three space separated integer representing Priority Number (PN), Process Number (PR), and Process Request ID (ID). Output Format Print the N space separated integers which represents Process Request