This article shows how to solve the N queens problem in 20 lines of code.
At codegolf.stackexchange.com, smaller is better.