in
for i in range(2, int(n ** 0.5) + 1):
if primes[i]:
primes[i * i: n: i] = [False] * len(primes[i * i: n: i])
why it must multiply with lenth???
in
for i in range(2, int(n ** 0.5) + 1):
if primes[i]:
primes[i * i: n: i] = [False] * len(primes[i * i: n: i])
why it must multiply with lenth???
@jimmydada said in Simple Python solution with stack:
very good idea using empty stack
what does that mean? one can return it rather than True?
@girikuncoro I don't see how you evade selling price needs to be larger than buying price (selling date later than buying date). Could you explain it?
Plus, what's the float('inf') for? Thanks.