LLMs Encode How Difficult Problems Are