According to The Hitchhiker's Guide to the Galaxy: 42 is the Answer to the Ultimate Question of Life, the Universe and Everything. This Answer was first calculated by the supercomputer Deep Thought after seven and a half million years of thought. This shocking answer resulted in the construction of an even larger supercomputer, named Earth, which was tasked with determining what the question was in the first place.
H2G2 books never claim 42 is the meaning of life; it is "the answer to the question of life, the universe, and everything". We don't know what that question is, so we don't know how 42 pertains to the meaning of life. –