Scala implementation of N-Queens