CTCI 8.2 Robot paths on an nxn board