Rishu Kumar’s Post

View profile for Rishu Kumar, graphic

Full-Stack Development (MERN) | LeetCode Enthusiast | Exploring Open Source & Hackathons

Day 50 on #LeetCode : Solved Problem of the Day Problem #1823 - Find the Winner of the Circular Game Description: This problem involves simulating a circular game where 'n' players are seated in a circle, and every 'k-th' player is eliminated until only one player remains. The task is to determine the winning player's position. Approach: Used a queue to represent the circle of players, where each player is initially added to the queue. Simulate the elimination process: Iterate through the queue, removing every 'k-th' player until only one player remains. Return the position of the last remaining player in the queue. This approach leverages a queue data structure to efficiently simulate the circular elimination game, ensuring that each elimination step is handled in O(1) time complexity due to queue operations. It's been a rewarding challenge to solve this problem and strengthen my understanding of queue-based simulations! #LeetCode #ProblemOfTheDay #Queue #Simulation #DailyCoding

  • text
Muhammad Hashir Awaiz

BS in AI`27 | Student at Ghulam Ishaq Khan Institute of Engineering Sciences and Technology

6mo

Insightful!

To view or add a comment, sign in

Explore topics