Skip to content

Instantly share code, notes, and snippets.

@Shaddyjr
Created August 30, 2019 19:51
Show Gist options
  • Save Shaddyjr/be0dd031b4512a35f40ee489d6d0cff6 to your computer and use it in GitHub Desktop.
Save Shaddyjr/be0dd031b4512a35f40ee489d6d0cff6 to your computer and use it in GitHub Desktop.
# All credit to CodeWars users: S666, hahanbyul, Lukegb94, Vesmil, CBR
import math
def movie(card, ticket, perc):
num = 0
priceA = 0
priceB = card
while math.ceil(priceB) >= priceA:
num += 1
priceA += ticket
priceB += ticket * (perc ** num)
return num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment