case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will be a positive integer. • 㟬ࡏᗡఐࢠɼཁᗡ̣㑊࠽။౸ɻ 㟬Ұ࣍ՄҎᗡҰ֨҃ၷ֨ɼ㟬༗زछՄೳతᗡ๏䏆ʁ PS. N ੋਖ਼Ꮠ
guard n > 1 else { return 1} var big = 1 var small = 1 for i in 2...n { let sum = big + small small = big big = sum } return big } } ࣌ؒෳᯑ: O(N) ۭؒෳᯑ: O(N) 16 ms