Skip to content

added circular queve game in python#31

Open
roshankraveendrababu wants to merge 3 commits intogdgpce:mainfrom
roshankraveendrababu:main
Open

added circular queve game in python#31
roshankraveendrababu wants to merge 3 commits intogdgpce:mainfrom
roshankraveendrababu:main

Conversation

@roshankraveendrababu
Copy link
Copy Markdown
Contributor

#17
the code for implementing circular queve game was added in python along with its examples and constraints in a seperate folder.
the intuition behind the code is :
A variable idx is initialized to 0
The loop continues while there are more than one friend left in the circle
the formula (idx + k - 1) % len(friends) is used to eliminate friends
The friend at the computed idx is eliminated using pop() and the process is repeated
when only one friend remains, that friend is the winner and the function returns this friend

the code also has algorithm and comment for each line for easy understanding ..

@Saket6198

This comment was marked as duplicate.

Copy link
Copy Markdown
Collaborator

@Saket6198 Saket6198 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roshankraveendrababu only commit the required file for the aforementioned issue, dont add solutions for other issues in your PR else it will be rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants