File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 173
173
| 1038| [ 从二叉搜索树到更大和树] ( https://leetcode.cn/problems/binary-search-tree-to-greater-sum-tree/ ) | [ JavaScript] ( ./algorithms/binary-search-tree-to-greater-sum-tree.js ) | Medium|
174
174
| 1047| [ 删除字符串中的所有相邻重复项] ( https://leetcode.cn/problems/remove-all-adjacent-duplicates-in-string/ ) | [ JavaScript] ( ./algorithms/remove-all-adjacent-duplicates-in-string.js ) | Easy|
175
175
| 1780| [ 判断一个数字是否可以表示成三的幂的和] ( https://leetcode.cn/problems/check-if-number-is-a-sum-of-powers-of-three/ ) | [ JavaScript] ( ./algorithms/check-if-number-is-a-sum-of-powers-of-three.js ) | Medium|
176
+ | 1832| [ 判断句子是否为全字母句] ( https://leetcode.cn/problems/check-if-the-sentence-is-pangram/ ) | [ JavaScript] ( ./algorithms/check-if-the-sentence-is-pangram.js ) | Easy|
176
177
| 面试题 04.12| [ 面试题 04.12. 求和路径] ( https://leetcode.cn/problems/paths-with-sum-lcci/ ) | [ JavaScript] ( ./algorithms/paths-with-sum-lcci.js ) | Medium|
177
178
| 面试题 02.07| [ 面试题 02.07. 链表相交] ( https://leetcode.cn/problems/intersection-of-two-linked-lists-lcci/ ) | [ JavaScript] ( ./algorithms/intersection-of-two-linked-lists-lcci.js ) | Easy|
178
179
| 剑指 Offer 05. 替换空格| [ 剑指 Offer 05. 替换空格] ( https://leetcode.cn/problems/ti-huan-kong-ge-lcof/ ) | [ JavaScript] ( ./algorithms/ti-huan-kong-ge-lcof.js ) | Easy|
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @param {string } sentence
3
+ * @return {boolean }
4
+ */
5
+ var checkIfPangram = function ( sentence ) {
6
+ const map = Array ( 26 ) . fill ( 0 ) ;
7
+
8
+ for ( let i = 0 ; i < sentence . length ; i ++ ) {
9
+ const index = sentence [ i ] . charCodeAt ( ) - 97 ;
10
+ map [ index ] ++ ;
11
+ }
12
+ for ( let i = 0 ; i < map . length ; i ++ ) {
13
+ if ( map [ i ] === 0 ) {
14
+ return false ;
15
+ }
16
+ }
17
+
18
+ return true ;
19
+ } ;
You can’t perform that action at this time.
0 commit comments