whalegia
V2EX  ›  问与答

[ LeetCode]最大值子序列,这个代码是不是算 cheating 呀?

  •  
  •   whalegia · Dec 5, 2014 · 2916 views
    This topic created in 4354 days ago, the information mentioned may be changed or developed.
    代码如下:


    就是要是发现输入的测试有小于 -10000 的例子的时候,就把 MaxSum 的初始值置为比测试值更小的值?
    2 replies  •  2014-12-05 05:10:48 +08:00
    shuding
    shuding
    Dec 5, 2014❤️1
    1
    漂亮的做法是初始化 `MaxSum` 为 `A[0]`...
    whalegia
    whalegia
    OP
    Dec 5, 2014
    2
    @shuding 是噢,谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4725 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 05:48 · PVG 13:48 · LAX 21:48 · JFK 00:48
    ♥ Do have faith in what you're doing.