File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,16 @@ leetcode 测试
10
10
11
11
##### 包含的内容如下
12
12
13
+ https://leetcode.cn/problems/bulb-switcher/
14
+
13
15
https://leetcode.cn/problems/concatenated-words/
14
16
15
17
https://leetcode.cn/problems/tag-validator/
16
18
17
19
https://leetcode.cn/problems/guess-the-word/
18
20
21
+ https://leetcode.cn/problems/bulb-switcher-ii/
22
+
19
23
https://leetcode.cn/problems/most-common-word/
20
24
21
25
https://leetcode-cn.com/problems/uncommon-words-from-two-sentences/
Original file line number Diff line number Diff line change
1
+ export default function flipLights ( n : number , m : number ) : number {
2
+ if ( ! n || ! m ) return 1 ;
3
+ else if ( n == 1 ) return 2 ;
4
+ else if ( n == 2 ) return 3 + Number ( m > 1 ) ;
5
+ else {
6
+ if ( m == 1 ) return 4 ;
7
+ else if ( m == 2 ) return 7 ;
8
+ else return 8 ;
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ export default function bulbSwitch ( n : number ) : number {
2
+ return Math . floor ( Math . sqrt ( n ) ) ;
3
+ }
You can’t perform that action at this time.
0 commit comments