Your question is Implement a Sorting Algorithm. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Dell PowerStore monitoring tools receive event records that must be displayed consistently. Implement a sorting algorithm of your choice to return the records ordered by timestamp ascending, then by severity descending. Records with identical keys must retain their original relative order.
Do not use Python's built-in sort() or sorted() functions, and do not modify the input list.
Implement sort_powerstore_events(events). The input is a list of dictionaries, where each dictionary contains:
id: a string identifying the eventtimestamp: an integer timestampseverity: an integer from 1 through 5, where 5 is most severeReturn a new list containing the same dictionaries in the required order. The algorithm must be stable.
def sort_powerstore_events(events):