An 18x18 would be fine for a small colubrid which would reach about 3-4 feet like an eastern milk or eastern king, IMO. For an adult corn which should reach the 4.5-6 foot range as an adult, I'd go bigger. Minimum I'd suggest is something equivalent to 24x24.
Personally, I give my snakes a lot more room than the "minimum" because I like to watch my snakes interact with their environment, roam, stretch, bask, move things around, sniff the the light, etc; so they receive bigger accomodations. Most of my snakes were recently moved into 36x24 pvc enclosures so they have room to stretch, climb, and burrow. Three of those snakes are 5 feet or will attain 5 feet in length. I've heard numerous people say snakes the size of a corn, large milk, or california king snake which reach around 5 feet in length is fine for its entire life in a 20L which I don't understand as the snake takes up half the tank when coiled up.
I also try to follow an enclosure guideline(not rule) of LxW of enclosure = snake's length.