Add dirty solution for the 24th problem