Skip to content

Commit 168d399

Browse files
author
openset
committed
Update: daily
1 parent 51cd377 commit 168d399

File tree

8 files changed

+51
-17
lines changed

8 files changed

+51
-17
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ LeetCode Problems' Solutions
5454

5555
| # | Title | Solution | Difficulty |
5656
| :-: | - | - | :-: |
57+
| <span id="1132">1132</span> | [Reported Posts II](https://leetcode.com/problems/reported-posts-ii) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/reported-posts-ii) | Medium |
5758
| <span id="1131">1131</span> | [Maximum of Absolute Value Expression](https://leetcode.com/problems/maximum-of-absolute-value-expression "绝对值表达式的最大值") | [Go](https://github.com/openset/leetcode/tree/master/problems/maximum-of-absolute-value-expression) | Medium |
5859
| <span id="1130">1130</span> | [Minimum Cost Tree From Leaf Values](https://leetcode.com/problems/minimum-cost-tree-from-leaf-values "叶值的最小代价生成树") | [Go](https://github.com/openset/leetcode/tree/master/problems/minimum-cost-tree-from-leaf-values) | Medium |
5960
| <span id="1129">1129</span> | [Shortest Path with Alternating Colors](https://leetcode.com/problems/shortest-path-with-alternating-colors "颜色交替的最短路径") | [Go](https://github.com/openset/leetcode/tree/master/problems/shortest-path-with-alternating-colors) | Medium |

problems/maximum-of-absolute-value-expression/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
[< Previous](https://github.com/openset/leetcode/tree/master/problems/minimum-cost-tree-from-leaf-values "Minimum Cost Tree From Leaf Values")
99

10-
Next >
10+
[Next >](https://github.com/openset/leetcode/tree/master/problems/reported-posts-ii "Reported Posts II")
1111

1212
## 1131. Maximum of Absolute Value Expression (Medium)
1313

problems/print-in-order/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@
1515

1616
<pre>
1717
public class Foo {
18-
&nbsp; public void one() { print(&quot;one&quot;); }
19-
&nbsp; public void two() { print(&quot;two&quot;); }
20-
&nbsp; public void three() { print(&quot;three&quot;); }
18+
&nbsp; public void first() { print(&quot;first&quot;); }
19+
&nbsp; public void second() { print(&quot;second&quot;); }
20+
&nbsp; public void third() { print(&quot;third&quot;); }
2121
}
2222
</pre>
2323

24-
<p>The same instance of <code>Foo</code> will be passed to three different threads. Thread A will call <code>one()</code>, thread B will call <code>two()</code>, and thread C will call <code>three()</code>. Design a mechanism and modify the program&nbsp;to ensure that&nbsp;<code>two()</code>&nbsp;is executed after&nbsp;<code>one()</code>, and&nbsp;<code>three()</code> is executed after&nbsp;<code>two()</code>.</p>
24+
<p>The same instance of <code>Foo</code> will be passed to three different threads. Thread A will call <code>first()</code>, thread B will call <code>second()</code>, and thread C will call <code>third()</code>. Design a mechanism and modify the program&nbsp;to ensure that&nbsp;<code>second()</code>&nbsp;is executed after&nbsp;<code>first()</code>, and&nbsp;<code>third()</code> is executed after&nbsp;<code>second()</code>.</p>
2525

2626
<p>&nbsp;</p>
2727

2828
<p><strong>Example 1:</strong></p>
2929

3030
<pre>
3131
<b>Input:</b> [1,2,3]
32-
<b>Output:</b> &quot;onetwothree&quot;
33-
<strong>Explanation:</strong> There are three threads being fired asynchronously. The input [1,2,3] means thread A calls one(), thread B calls two(), and thread C calls three(). &quot;onetwothree&quot; is the correct output.
32+
<b>Output:</b> &quot;firstsecondthird&quot;
33+
<strong>Explanation:</strong> There are three threads being fired asynchronously. The input [1,2,3] means thread A calls first(), thread B calls second(), and thread C calls third(). &quot;firstsecondthird&quot; is the correct output.
3434
</pre>
3535

3636
<p><strong>Example 2:</strong></p>
3737

3838
<pre>
3939
<b>Input:</b> [1,3,2]
40-
<b>Output:</b> &quot;onetwothree&quot;
41-
<strong>Explanation:</strong> The input [1,3,2] means thread A calls one(), thread B calls three(), and thread C calls two(). &quot;onetwothree&quot; is the correct output.</pre>
40+
<b>Output:</b> &quot;firstsecondthird&quot;
41+
<strong>Explanation:</strong> The input [1,3,2] means thread A calls first(), thread B calls third(), and thread C calls second(). &quot;firstsecondthird&quot; is the correct output.</pre>
4242

4343
<p>&nbsp;</p>
4444

problems/reported-posts-ii/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
2+
<!--+----------------------------------------------------------------------+-->
3+
<!--|@author Openset <[email protected]> |-->
4+
<!--|@link https://github.com/openset |-->
5+
<!--|@home https://github.com/openset/leetcode |-->
6+
<!--+----------------------------------------------------------------------+-->
7+
8+
[< Previous](https://github.com/openset/leetcode/tree/master/problems/maximum-of-absolute-value-expression "Maximum of Absolute Value Expression")
9+
                
10+
Next >
11+
12+
## 1132. Reported Posts II (Medium)
13+
14+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Create table If Not Exists Actions (user_id int, post_id int, action_date date, action ENUM('view', 'like', 'reaction', 'comment', 'report', 'share'), extra varchar(10));
2+
create table if not exists Removals (post_id int, remove_date date);
3+
Truncate table Actions;
4+
insert into Actions (user_id, post_id, action_date, action, extra) values ('1', '1', '2019-07-01', 'view', 'None');
5+
insert into Actions (user_id, post_id, action_date, action, extra) values ('1', '1', '2019-07-01', 'reaction', 'love');
6+
insert into Actions (user_id, post_id, action_date, action, extra) values ('1', '1', '2019-07-01', 'share', 'None');
7+
insert into Actions (user_id, post_id, action_date, action, extra) values ('2', '2', '2019-07-04', 'view', 'None');
8+
insert into Actions (user_id, post_id, action_date, action, extra) values ('2', '2', '2019-07-04', 'report', 'spam');
9+
insert into Actions (user_id, post_id, action_date, action, extra) values ('3', '4', '2019-07-04', 'view', 'None');
10+
insert into Actions (user_id, post_id, action_date, action, extra) values ('3', '4', '2019-07-04', 'report', 'spam');
11+
insert into Actions (user_id, post_id, action_date, action, extra) values ('4', '3', '2019-07-02', 'view', 'None');
12+
insert into Actions (user_id, post_id, action_date, action, extra) values ('4', '3', '2019-07-02', 'report', 'spam');
13+
insert into Actions (user_id, post_id, action_date, action, extra) values ('5', '2', '2019-07-04', 'view', 'None');
14+
insert into Actions (user_id, post_id, action_date, action, extra) values ('5', '2', '2019-07-04', 'report', 'racism');
15+
insert into Actions (user_id, post_id, action_date, action, extra) values ('5', '5', '2019-07-04', 'view', 'None');
16+
insert into Actions (user_id, post_id, action_date, action, extra) values ('5', '5', '2019-07-04', 'report', 'racism');
17+
Truncate table Removals;
18+
insert into Removals (post_id, remove_date) values ('2', '2019-07-20');
19+
insert into Removals (post_id, remove_date) values ('3', '2019-07-18');

readme/301-600.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ LeetCode Problems' Solutions
191191
| <span id="435">435</span> | [Non-overlapping Intervals](https://leetcode.com/problems/non-overlapping-intervals "无重叠区间") | [Go](https://github.com/openset/leetcode/tree/master/problems/non-overlapping-intervals) | Medium |
192192
| <span id="436">436</span> | [Find Right Interval](https://leetcode.com/problems/find-right-interval "寻找右区间") | [Go](https://github.com/openset/leetcode/tree/master/problems/find-right-interval) | Medium |
193193
| <span id="437">437</span> | [Path Sum III](https://leetcode.com/problems/path-sum-iii "路径总和 III") | [Go](https://github.com/openset/leetcode/tree/master/problems/path-sum-iii) | Easy |
194-
| <span id="438">438</span> | [Find All Anagrams in a String](https://leetcode.com/problems/find-all-anagrams-in-a-string "找到字符串中所有字母异位词") | [Go](https://github.com/openset/leetcode/tree/master/problems/find-all-anagrams-in-a-string) | Easy |
194+
| <span id="438">438</span> | [Find All Anagrams in a String](https://leetcode.com/problems/find-all-anagrams-in-a-string "找到字符串中所有字母异位词") | [Go](https://github.com/openset/leetcode/tree/master/problems/find-all-anagrams-in-a-string) | Medium |
195195
| <span id="439">439</span> | [Ternary Expression Parser](https://leetcode.com/problems/ternary-expression-parser "三元表达式解析器") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/ternary-expression-parser) | Medium |
196196
| <span id="440">440</span> | [K-th Smallest in Lexicographical Order](https://leetcode.com/problems/k-th-smallest-in-lexicographical-order "字典序的第K小数字") | [Go](https://github.com/openset/leetcode/tree/master/problems/k-th-smallest-in-lexicographical-order) | Hard |
197197
| <span id="441">441</span> | [Arranging Coins](https://leetcode.com/problems/arranging-coins "排列硬币") | [Go](https://github.com/openset/leetcode/tree/master/problems/arranging-coins) | Easy |

tag/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
| 9 | [Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md) | [贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md) | | 10 | [Two Pointers](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md) | [双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md) |
1717
| 11 | [Breadth-first Search](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md) | [广度优先搜索](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md) | | 12 | [Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md) | [](https://github.com/openset/leetcode/tree/master/tag/stack/README.md) |
1818
| 13 | [Backtracking](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md) | [回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md) | | 14 | [Design](https://github.com/openset/leetcode/tree/master/tag/design/README.md) | [设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md) |
19-
| 15 | [Linked List](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md) | [链表](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md) | | 16 | [Heap](https://github.com/openset/leetcode/tree/master/tag/heap/README.md) | [](https://github.com/openset/leetcode/tree/master/tag/heap/README.md) |
20-
| 17 | [Sort](https://github.com/openset/leetcode/tree/master/tag/sort/README.md) | [排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md) | | 18 | [Bit Manipulation](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md) | [位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md) |
19+
| 15 | [Linked List](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md) | [链表](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md) | | 16 | [Bit Manipulation](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md) | [位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md) |
20+
| 17 | [Heap](https://github.com/openset/leetcode/tree/master/tag/heap/README.md) | [](https://github.com/openset/leetcode/tree/master/tag/heap/README.md) | | 18 | [Sort](https://github.com/openset/leetcode/tree/master/tag/sort/README.md) | [排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md) |
2121
| 19 | [Graph](https://github.com/openset/leetcode/tree/master/tag/graph/README.md) | [](https://github.com/openset/leetcode/tree/master/tag/graph/README.md) | | 20 | [Union Find](https://github.com/openset/leetcode/tree/master/tag/union-find/README.md) | [并查集](https://github.com/openset/leetcode/tree/master/tag/union-find/README.md) |
2222
| 21 | [Divide and Conquer](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md) | [分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md) | | 22 | [Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md) | [Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md) |
2323
| 23 | [Trie](https://github.com/openset/leetcode/tree/master/tag/trie/README.md) | [字典树](https://github.com/openset/leetcode/tree/master/tag/trie/README.md) | | 24 | [Recursion](https://github.com/openset/leetcode/tree/master/tag/recursion/README.md) | [递归](https://github.com/openset/leetcode/tree/master/tag/recursion/README.md) |

tag/tags.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
"Slug": "linked-list",
7575
"TranslatedName": "链表"
7676
},
77+
{
78+
"Name": "Bit Manipulation",
79+
"Slug": "bit-manipulation",
80+
"TranslatedName": "位运算"
81+
},
7782
{
7883
"Name": "Heap",
7984
"Slug": "heap",
@@ -84,11 +89,6 @@
8489
"Slug": "sort",
8590
"TranslatedName": "排序"
8691
},
87-
{
88-
"Name": "Bit Manipulation",
89-
"Slug": "bit-manipulation",
90-
"TranslatedName": "位运算"
91-
},
9292
{
9393
"Name": "Graph",
9494
"Slug": "graph",

0 commit comments

Comments
 (0)