File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
check-if-the-sentence-is-pangram Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ Step 2. Add the dependency
45
45
46
46
<summary >展开查看</summary >
47
47
48
+ https://leetcode.cn/problems/check-if-the-sentence-is-pangram/
49
+
48
50
https://leetcode-cn.com/problems/sum-of-beauty-of-all-substrings/
49
51
50
52
https://leetcode-cn.com/problems/maximum-value-of-a-string-in-an-array/
Original file line number Diff line number Diff line change
1
+ function checkIfPangram ( sentence : string ) : boolean {
2
+ return 26 === new Set ( sentence ) . size ;
3
+ }
4
+ export default checkIfPangram ;
Original file line number Diff line number Diff line change 1
1
class SnapshotArray {
2
- shot : number ;
3
- map : Map < string , number > ;
2
+ # shot: number ;
3
+ # map: Map < string , number > ;
4
4
constructor ( _length : number ) {
5
- this . shot = 0 ;
6
- this . map = new Map ( ) ;
5
+ this . # shot = 0 ;
6
+ this . # map = new Map ( ) ;
7
7
}
8
8
9
9
set ( index : number , val : number ) : void {
10
- this . map . set ( `${ this . shot } -${ index } ` , val ) ;
10
+ this . # map. set ( `${ this . # shot} -${ index } ` , val ) ;
11
11
}
12
12
13
13
snap ( ) : number {
14
- return this . shot ++ ;
14
+ return this . # shot++ ;
15
15
}
16
16
17
17
get ( index : number , snap_id : number ) : number {
18
18
for ( let i = snap_id ; i >= 0 ; i -- ) {
19
- const val = this . map . get ( `${ i } -${ index } ` ) ;
19
+ const val = this . # map. get ( `${ i } -${ index } ` ) ;
20
20
if ( val !== undefined ) {
21
21
return val ;
22
22
}
You can’t perform that action at this time.
0 commit comments