Skip to content

Commit ed609a1

Browse files
Merge pull request SharingSource#61 from SharingSource/ac_oier
✨feat: Modify 1736 & 1893
2 parents 3ff438e + b3522a2 commit ed609a1

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

LeetCode/1731-1740/1736. 替换隐藏数字得到的最晚时间(简单).md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Tag : 「贪心」
5353
代码:
5454
```Java
5555
class Solution {
56-
static
5756
public String maximumTime(String time) {
5857
StringBuilder sb = new StringBuilder();
5958
sb.append(time.charAt(0) == '?' ? (time.charAt(1) == '?' || time.charAt(1) < '4') ? '2' : '1' : time.charAt(0));

LeetCode/1891-1900/1893. 检查是否区域内所有整数都被覆盖(简单).md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class Solution {
124124

125125
在朴素的「树状数组」解法中,我们无法直接查询 $[l, r]$ 区间中被覆盖过的个数的根本原因是「某个值可能会被重复添加到树状数组中」。
126126

127-
因此,一种更加优秀的做法:**在往树状数组中添树的时候进行去重,然后通过 $cnt = query(r) - query(l - 1)$ 直接得出 $[l, r]$ 范围内有多少个数被添加过。**
127+
因此,一种更加优秀的做法:**在往树状数组中添数的时候进行去重,然后通过 $cnt = query(r) - query(l - 1)$ 直接得出 $[l, r]$ 范围内有多少个数被添加过。**
128128

129129
这样的 `Set` 去重操作可以使得我们查询的复杂度从 $O(n\log{C})$ 下降到 $O(\log{C})$。
130130

0 commit comments

Comments
 (0)