donnemartin / interactive-coding-challenges

120+ interactive Python coding interview challenges (algorithms and data structures). Includes Anki flashcards.
Other
29.44k stars 4.45k forks source link

Simplify loop in max profit challenge #214

Closed kagemusha closed 6 years ago

donnemartin commented 7 years ago

Hi @kagemusha this seems like a clever optimization. I'm mobile at the moment and can't check, this passes unit tests?

kagemusha commented 7 years ago

@donnemartin yes it does

hmeng1995 commented 7 years ago

i don't know

------------------ 原始邮件 ------------------ 发件人: "Donne Martin";notifications@github.com; 发送时间: 2017年10月14日(星期六) 上午8:25 收件人: "donnemartin/interactive-coding-challenges"interactive-coding-challenges@noreply.github.com; 抄送: "Subscribed"subscribed@noreply.github.com; 主题: Re: [donnemartin/interactive-coding-challenges] max_profit_solution:simplify loop by popping first price (#214)

Hi @kagemusha this seems like a clever optimization. I'm mobile at the moment and can't check, this passes unit tests?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

donnemartin commented 6 years ago

@kagemusha thank you!