Slightly optimized Euler12 by removing use of LinkedList