CodeEval challenge: Grid Walk
<p>There is a challenge from CodeEval, called Grid Walk.</p>

<p>Programming language doesn't really matter.</p>

<p>I've tried to crack it down, and I thought I did, as the answers my program gave me to smaller numbers (9 and 10) were correct according to an on-paper drawing.</p>

<p>As my program says, the final result should be 111005, but CodeEval doesn't seem to agree with that.</p>

<p>Can anyone point me to the right direction?
What is the correct answer? A hint?</p>

<p>The <a href="http://www.codeeval.com/open_challenges/60/" rel="nofollow">challenge</a>:</p>

<blockquote>
  <p>There is a monkey which can walk around on a planar grid. The monkey
  can move one space at a time left, right, up or down. That is, from
  (x, y) the monkey can go to (x+1, y), (x-1, y), (x, y+1), and (x,
  y-1). Points where the sum of the digits of the absolute value of the
  x coordinate plus the sum of the digits of the absolute value of the y
  coordinate are lesser than or equal to 19 are accessible to the
  monkey. For example, the point (59, 79) is inaccessible because 5 + 9
  + 7 + 9 = 30, which is greater than 19. Another example: the point (-5, -7) is accessible because abs(-5) + abs(-7) = 5 + 7 = 12, which
  is less than 19. How many points can the monkey access if it starts at
  (0, 0), including (0, 0) itself?</p>
</blockquote>

<p>And a picture of where my program thinks the monkey can walk (green areas),
going from -298 to 298 in both X and Y axis, (0,0) being the center.</p>

<p><img src="http://i.stack.imgur.com/dGAOT.png" alt="NotSolution"></p>

<p><strong>UPDATE:</strong></p>

<p>I have the solution now. As I was building the points through the axis, I demanded that the previous y or the previous x were good, so this made me lose all the extra unreachable locations, leaving me with this, the right amount: 102485</p>

<p><img src="http://i.stack.imgur.com/d2b5l.png" alt="Solution"></p>
