add solution for the mario problem