File tree Expand file tree Collapse file tree 2 files changed +32
-17
lines changed Expand file tree Collapse file tree 2 files changed +32
-17
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ deno task lint
72
72
73
73
5.导入模块
74
74
75
+ 不指定版本号
76
+
75
77
``` ts
76
78
import {} from " https://gitee.com/masx200/leetcode-test/raw/master/mod.ts" ;
77
79
```
@@ -84,6 +86,20 @@ import {} from "https://github.com/masx200/leetcode-test/raw/master/mod.ts";
84
86
import {} from " https://cdn.jsdelivr.net/gh/masx200/leetcode-test/mod.ts" ;
85
87
```
86
88
89
+ 指定版本号
90
+
91
+ ``` ts
92
+ import {} from " https://gitee.com/masx200/leetcode-test/raw/4.0.1/mod.ts" ;
93
+ ```
94
+
95
+ ``` ts
96
+ import {} from " https://github.com/masx200/leetcode-test/raw/4.0.1/mod.ts" ;
97
+ ```
98
+
99
+ ``` ts
100
+ import {} from " https://cdn.jsdelivr.net/gh/masx200/leetcode-test@4.0.1/mod.ts" ;
101
+ ```
102
+
87
103
6.使用举例
88
104
89
105
``` ts
Original file line number Diff line number Diff line change @@ -25,26 +25,25 @@ export default function myPow(x: number, n: number): number {
25
25
// return cached;
26
26
// }
27
27
28
- const result =
29
- n === 1
30
- ? x
31
- : x < 0
32
- ? ( n % 2 === 0 ? 1 : - 1 ) * myPow ( - x , n )
33
- : x === 1
34
- ? 1
35
- : x === 0
36
- ? 0
37
- : n === 0
38
- ? 1
39
- : n < 0
40
- ? myPow ( 1 / x , - n )
41
- : n % 2
42
- ? x * myPow ( x , n - 1 )
43
- : /* lazyMultiplyPositive(
28
+ const result = n === 1
29
+ ? x
30
+ : x < 0
31
+ ? ( n % 2 === 0 ? 1 : - 1 ) * myPow ( - x , n )
32
+ : x === 1
33
+ ? 1
34
+ : x === 0
35
+ ? 0
36
+ : n === 0
37
+ ? 1
38
+ : n < 0
39
+ ? myPow ( 1 / x , - n )
40
+ : n % 2
41
+ ? x * myPow ( x , n - 1 )
42
+ : /* lazyMultiplyPositive(
44
43
() => x,
45
44
() => myPow(x, n - 1)
46
45
) */
47
- myPow ( x * x , Math . floor ( n / 2 ) ) ;
46
+ myPow ( x * x , Math . floor ( n / 2 ) ) ;
48
47
/* lazyMultiplyPositive(
49
48
() => myPow(x, Math.floor(n / 2)),
50
49
() => myPow(x, n - Math.floor(n / 2)),
You can’t perform that action at this time.
0 commit comments