Pergunta de entrevista da empresa PayPal

Given an array of temperatures for a given week, write a function that returns an array which contains the number of days you will need to wait for a warmer temperature on each day. Ex: Given [71, 72, 73, 71, 74, 75, 60] Return [1, 1, 2, 1, 1, 0, 0] For the first day you'd have to wait until the second day for a warmer temperature (71->72). So, index 0 is 1. For the last day, there is no temperature after it, so you just set the index 6 to 0.