Nandan Gogari’s Post

🚀 Leveling Up with LeetCode 75 Day #13 – Two problems, two lessons in simulation 🟡 Easy: Number of Recent Calls (933) Task: Count requests in the last 3000 ms. Insight: A queue models the sliding window perfectly. Practiced both idiomatic Kotlin (ArrayDeque) and manual array-based solutions for interview prep. Why it matters: Teaches how to maintain dynamic windows efficiently. 🟡 Medium: Dota2 Senate (649) Task: Simulate banning between Radiant and Dire senators until one party wins. Insight: Two queues track indices; smaller index acts first. Simulation continues until one queue empties. Why it matters: Shows how queues can model turn-based processes and dynamic elimination. ✨ Key Learning Queue → sliding windows and simulations. Simulation problems often reduce to “model the process with the right data structure.” 💡 My takeaway: Queues aren’t just for BFS — they’re powerful for modeling time and turn-based dynamics. #LeetCode #CodingInterview #ProblemSolving #Kotlin #DataStructures #Algorithms

To view or add a comment, sign in

Explore content categories