Problem 23 done.
A bit on the slow side, running time is 30 seconds.
I'll take a look at where I can gain most speed now.