Slowish bisection based solution for 255 (runs in 8 mins).