Please chek this pdf file for the details on the problem.
Please also check this submission, where a more general dynamic programming algorithm is used to sove this problem. You can also find a general implementation of value iteration implemented there.
This is an example for a 400 x 400 grids:
The car is replaced with Universitas Pertamina's logo ;-)