• Asked to answer
    + 2 comments
    Endorsed by love1024

    Forget about the killer array... Read this(mjolka's Spoilers part): http://codereview.stackexchange.com/questions/104544/hacker-rank-poisonous-plants

    When you asked me, I didn't do it. Brute-force can pass all except 5 timeout, and I don't understand the killer array. However, after I did some Google and found this, I finished my code in around 20 lines in Python in half an hour. Take a try! Just push all elements once according to some conditions and pop some elements according to some conditions, and at the meantime, push the day that the plant will die with the plant, and also remember to trace the maximum day. Good luck!