There is a challenge from CodeEval, called Grid Walk.
Programming language doesn’t really matter.
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.
As my program says, the final result should be 111005, but CodeEval doesn’t seem to agree with that.
Can anyone point me to the right direction?
What is the correct answer? A hint?
The challenge:
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?
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.

UPDATE:
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

Perform a flood-fill from (0,0) on the shape you’ve found, and you get all the points accessible from (0,0).