Skip to content

Commit

Permalink
Merge pull request neetcode-gh#1280 from EmceeA/patch-1
Browse files Browse the repository at this point in the history
Climbing Stairs 100% faster
  • Loading branch information
Ahmad-A0 authored Oct 21, 2022
2 parents 9db3cfb + 92f9cd2 commit 5ec6bd8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions csharp/70-Climbing Stairs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
public class Solution {
public int ClimbStairs(int n) {

int one = 1;
int two = 1;

for(int i = 0; i < n - 1; i++)
{
int temp = one;
one = one + two;
two = temp;
}

return one;
}
}

0 comments on commit 5ec6bd8

Please sign in to comment.