Monday, July 29, 2013

HR Red John is back

https://www.hackerrank.com/contests/101july13/challenges/red-john-is-back

Easy solution with the little dp and prime with very mild constraints




2 comments:

  1. can u explain how u derived f[i] = f[i-1] +f[i-4]

    ReplyDelete
    Replies
    1. Basically for every move you have two options: place a 4x1 brick or a 1x4 brick

      Delete