Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • \$\begingroup\$ These three differences make things much terser. We can shorten the indexing and combine several redundant data structures. The logic for pushing visits forward turns out to be much shorter than the logic for pulling visits from previous cells. Horizontal boundary conditions are handled simply by extending the data structure an extra space to the right, and vertical boundary conditions aren't an issue. \$\endgroup\$ Commented Apr 5, 2014 at 5:47
  • \$\begingroup\$ I've upvoted your answer and incorporated the concepts into my own code. So far, they've taken 84 bytes out of my solution, an improvement of 30%. \$\endgroup\$ Commented Apr 5, 2014 at 5:50
  • \$\begingroup\$ I suspect you might be able to save some bytes by not doing --*o;, and instead switching which case you move the guy down and which case you move the guy to the right. \$\endgroup\$ Commented Apr 5, 2014 at 5:59
  • \$\begingroup\$ @user2357112 Implemented, but code length increase due to a previous mistake (It should have been 218 bytes). \$\endgroup\$ Commented Apr 5, 2014 at 8:20