Google interview question

a leetcode question on climbing ladder