Process Messages (FrontEnd focused Full-Stack Eng :)
You are developing a messaging system that needs to process messages in a specific order. Each message has a timestamp and a priority level (1 to 5, where 1 is highest priority). Messages should be processed based on the following rules: higher priority messages should be processed first, and among messages with the same priority, earlier timestamps should be processed first. Write a function that takes an array of messages (each containing timestamp and priority) and returns them in the correct processing order. Each message in the input array will be in the format: 'timestamp:priority'.
Complete the function processMessages in the editor.
processMessages has the following parameter:
String[] messages: an array of strings where each string is in the format 'timestamp:priority'
Returns
String[]: an array of messages in the correct processing order
Requirements: