added solution for 12, but need to improve performance before running it for euler