SHARE
TWEET

Untitled

a guest Mar 26th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func climbStairs(n int) int {
  2.     if n <= 1 {
  3.         return n
  4.     }
  5.     first := 1
  6.     second := 2
  7.     for i := 3; i <= n; i++ {
  8.         first, second = second, first+second
  9.     }
  10.     return second
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top