Skip to content

Instantly share code, notes, and snippets.

@modos
Created March 15, 2023 14:09
Show Gist options
  • Save modos/29408738da5ce04cda759c171bc41cf4 to your computer and use it in GitHub Desktop.
Save modos/29408738da5ce04cda759c171bc41cf4 to your computer and use it in GitHub Desktop.
انتخابات ریاست جمهوری
def Josh(person, k, index):
if len(person) == 1:
print(person[0])
return
index = ((index+k)%len(person))
person.pop(index)
Josh(person,k,index)
n = int(input())
k = 1
index = 0
person=[]
for i in range(1,n+1):
person.append(i)
Josh(person,k,index)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment