Hi team,
I have a doubt regarding time complexity for this Increasing Temperature question.
As per the solution provided, the time complexity of this question should be O(n) but since we are using two loop-
- for loop to iterate over array elements and
- while loop for finding next higher temperature & updating answer array
So shouldn’t the time complexity be O(N2).