Time spent thinking about a problem is always time well spent. Even if you seem to make no progress at all.