Pergunta de entrevista da empresa Epic

Snake matrix code question, find all snake paths to the end of a matrix