This one is quite difficult, it sacrifices some readability for cleverness and conciseness. I find Algorithmic Thinking by Zingaro much more approachable but almost as dense.
Remember, these are throwaway programs; not something that you need to worry about someone else maintaining, or something you need to worry about opening up 5 years later.
The coding style demonstrated here is extremely common with high-level competitive teams.