Given a list of daily temperatures, return an array with the next greater temperature for each day.
For each position, return the first temperature to its right that is strictly greater. If no greater temperature exists, return 0.
Implement def next_greater_temperatures(temperatures):, where the input and output are integer arrays of equal length.
def next_greater_temperatures(temperatures):