Dsa
Monotonic Stack
Hard
Daily Activity Tracker
You are given a list of integers representing the number of activities done each day. For each day, you want to know how many more days you would need to track until you have a day with activity count greater than or equal to the current day. If there are no such days ahead, return -1.
Input format:
- A single line containing integers separated by spaces, representing daily activities.
Output format:
- A single line containing integers separated by spaces, representing the days until a greater or equal activity count.
Example:
Input:
1 2 3 2 1 4 2
Output:
1 1 2 1 1 -1 -1
Key concepts
monotonic_stackactivityduration
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now