Lolita author Vladimir Nabokov, who wrote the screen adaptation of the book, originally wrote an incredibly extensive first version of the script. It ran for an astonishing four hundred pages, which would have equated to around seven hours of film. Only after heavy editing from Kubrick and his producer James Harris, was the script finally able to be made.
The novelist Calder Willingham, who was the author and screenwriter of Paths of Glory (an earlier Kubrick film), advised both Nabokov and Kubrick to turn Lolita into a film. Willingham initially took the reigns of the Lolita screenplay before stepping aside for Nabokov himself.
Nabokov stated at the time, that he had witnessed during a dream a realization of the Lolita screenplay, and described it as a “nocturnal illumination of diabolical origin”
Here is an original memo from Nabokov, addressed to Kubrick, about changes the former had made to the screenplay.