The recurrence of sushi prblm

pls explain me the logic and the recurrence of sushi prblm. I cannot understand anything of it.