Skip to content

Commit 24d08f8

Browse files
committed
https://leetcode.cn/problems/check-if-the-sentence-is-pangram/
1 parent d8b925b commit 24d08f8

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Step 2. Add the dependency
4545

4646
<summary>展开查看</summary>
4747

48+
https://leetcode.cn/problems/check-if-the-sentence-is-pangram/
49+
4850
https://leetcode-cn.com/problems/sum-of-beauty-of-all-substrings/
4951

5052
https://leetcode-cn.com/problems/maximum-value-of-a-string-in-an-array/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function checkIfPangram(sentence: string): boolean {
2+
return 26 === new Set(sentence).size;
3+
}
4+
export default checkIfPangram;

snapshot-array/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
class SnapshotArray {
2-
shot: number;
3-
map: Map<string, number>;
2+
#shot: number;
3+
#map: Map<string, number>;
44
constructor(_length: number) {
5-
this.shot = 0;
6-
this.map = new Map();
5+
this.#shot = 0;
6+
this.#map = new Map();
77
}
88

99
set(index: number, val: number): void {
10-
this.map.set(`${this.shot}-${index}`, val);
10+
this.#map.set(`${this.#shot}-${index}`, val);
1111
}
1212

1313
snap(): number {
14-
return this.shot++;
14+
return this.#shot++;
1515
}
1616

1717
get(index: number, snap_id: number): number {
1818
for (let i = snap_id; i >= 0; i--) {
19-
const val = this.map.get(`${i}-${index}`);
19+
const val = this.#map.get(`${i}-${index}`);
2020
if (val !== undefined) {
2121
return val;
2222
}

0 commit comments

Comments
 (0)