1.5 Zeeshan's Wild Wait: Predicting Peak Animal Energy ✨
Zeeshan is observing a group of animals in a zoo. He records the daily activity levels of a specific animal species as an array of integers, where each integer represents the animal's activity level on that day.
Consider an array of integers activityLevels representing the daily activity levels of the animals, print an array waitTimes such that waitTimes[i] is the number of days Zeeshan has to wait after the ith day to observe a higher activity level in the same animal. If there is no future day with a higher activity level, waitTimes[i] should be 0.
Constraints
1 <= ActivityLevels.length <= 10^5
30 <= ActivityLevels[i] <= 100
Input Format
Array of Integers representing the Activity Levels
Output Format
Array of Integers representing the wait times for Each Element..
Example 1
Input:
8
55 43 72 63 37 49 51 77
Output:
2 1 5 4 1 1 1 0
Explanation:
Self Explanatory
Log In to solve the Question