Solved no31
Did a smart and a naive solution. The naive solution benchmarked best :-S