{"push_id":721598232,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"7062f428146989d315dd7ca2daf8c875fae60d6b","before":"5902f8d953e66d120e61135bb29eb0f81599d0b9","commits":[{"sha":"7062f428146989d315dd7ca2daf8c875fae60d6b","author":{"email":"20b64075497e2c4783199ac4b659f01f676cfd10@gmail.com","name":"Kienen"},"message":"Save Beta Rabbit\n\nSave Beta Rabbit\n================\n\nOh no! The mad Professor Boolean has trapped Beta Rabbit in an NxN grid\nof rooms. In the center of\neach room (except for the top left room) is a hungry zombie. In order to\nbe freed, and to avoid being\neaten, Beta Rabbit must move through this grid and feed the zombies.\n\nBeta Rabbit starts at the top left room of the grid. For each room in\nthe grid, there is a door to\nthe room above, below, left, and right. There is no door in cases where\nthere is no room in that\ndirection. However, the doors are locked in such a way that Beta Rabbit\ncan only ever move to the\nroom below or to the right. Once Beta Rabbit enters a room, the zombie\nimmediately starts crawling\ntowards him, and he must feed the zombie until it is full to ward it\noff. Thankfully, Beta Rabbit\ntook a class about zombies and knows how many units of food each zombie\nneeds be full.\n\nTo be freed, Beta Rabbit needs to make his way to the bottom right room\n(which also has a hungry\nzombie) and have used most of the limited food he has. He decides to\ntake the path through the grid\nsuch that he ends up with as little food as possible at the end.\n\nWrite a function answer(food, grid) that returns the number of units of\nfood Beta Rabbit will have at\nthe end, given that he takes a route using up as much food as possible\nwithout him being eaten, and\nends at the bottom right room. If there does not exist a route in which\nBeta Rabbit will not be\neaten, then return -1.\n\nfood is the amount of food Beta Rabbit starts with, and will be a\npositive integer no larger than\n200.\n\ngrid will be a list of N elements. Each element of grid will itself be a\nlist of N integers each,\ndenoting a single row of N rooms. The first element of grid will be the\nlist denoting the top row,\nthe second element will be the list denoting second row from the top,\nand so on until the last\nelement, which is the list denoting the bottom row. In the list denoting\na single row, the first\nelement will be the amount of food the zombie in the left-most room in\nthat row needs, the second\nelement will be the amount the zombie in the room to its immediate right\nneeds and so on. The top\nleft room will always contain the integer 0, to indicate that there is\nno zombie there.\n\nThe number of rows N will not exceed 20, and the amount of food each\nzombie requires will be a\npositive integer not exceeding 10.\n\nLanguages\n=========\n\nTo provide a Python solution, edit solution.py\nTo provide a Java solution, edit solution.java\n\nTest cases\n==========\n\nInputs:\n(int) food = 7\n(int) grid = [[0, 2, 5], [1, 1, 3], [2, 1, 1]]\nOutput:\n(int) 0\n\nInputs:\n(int) food = 12\n(int) grid = [[0, 2, 5], [1, 1, 3], [2, 1, 1]]\nOutput:\n(int) 1\n\nUse verify [file] to test your solution and see how it does. When you\nare finished editing your code,\nuse submit [file] to submit your answer. If your solution passes the\ntest cases, it will be removed\nfrom your home folder.","distinct":true,"url":"https://api.github.com/repos/Kienen/Google_Foo.bar/commits/7062f428146989d315dd7ca2daf8c875fae60d6b"}]}