"first" lmao
const movie = (card, ticket, part) => { let i = 0 let a = 0 let b = card do { a += ticket b += ticket * part ** i i++ } while (Math.ceil(b) >= a) return i - 1 }
an "optimization" (no power)
const movie = (card, ticket, part) => { let i = 0 let a = 0 let b = card let cheap = ticket while (true) { a += ticket b += cheap cheap *= part if (Math.ceil(b) < a) return i i++ } }
"optimization II" (no Math.ceil, comparison with 0 instead of 1)
Math.ceil
const movie = (card, ticket, part) => { let i = 0 let dif = -card - 1 let cheap = ticket while (true) { dif += ticket - cheap cheap *= part if (dif > 0) return i i++ } }
idiocy.
const movie = (card, ticket, part) => { let i = 1 let dif = -card - 1 let cheap = ticket while ((dif += ticket - (cheap *= part)) <= 0) i++ return i }
denied on first lol
Check timestamp by hovering the date lol
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
"first" lmao
an "optimization" (no power)
"optimization II" (no
Math.ceil
, comparison with 0 instead of 1)idiocy.
denied on first lol
Check timestamp by hovering the date lol