Skip to content

Instantly share code, notes, and snippets.

@Shaddyjr
Created August 30, 2019 19:36
Show Gist options
  • Save Shaddyjr/5cf5a36f54c88c727af716c789b364fb to your computer and use it in GitHub Desktop.
Save Shaddyjr/5cf5a36f54c88c727af716c789b364fb to your computer and use it in GitHub Desktop.
import math
def movie(card, ticket, perc):
ticket_num = 0
sys_a = 0
sys_b_prev = ticket
while math.ceil(card) >= sys_a:
sys_a += ticket
sys_b_prev *= perc
card += sys_b_prev
ticket_num += 1
return ticket_num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment