The conversation between human and AI assistant.
How do I write an algorithm to find the nth highest number in an array?
I need to write an algorithm to find the nth highest number in an array. How can I do that?
Sure, I can help you with that! One way to do it is to sort the array in descending order and then return the element at index n-1. Would you like me to write the code for you?