We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 076ecc9 commit 3031ef3Copy full SHA for 3031ef3
lcof/面试题10- I. 斐波那契数列/README.md
@@ -112,6 +112,19 @@ func fib(n int) int {
112
}
113
```
114
115
+### **TypeScript**
116
+
117
+```ts
118
+function fib(n: number): number {
119
+ let a: number = 0, b: number = 1;
120
+ for (let i: number = 0; i < n; i++) {
121
+ let c: number = (a + b) % 1000000007;
122
+ [a, b] = [b, c];
123
+ }
124
+ return a;
125
+};
126
+```
127
128
### **...**
129
130
lcof/面试题10- I. 斐波那契数列/Solution.ts
@@ -0,0 +1,8 @@
1
2
3
4
5
6
7
8
0 commit comments