Created
August 30, 2019 19:36
-
-
Save Shaddyjr/5cf5a36f54c88c727af716c789b364fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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