[leetcode][Python][Concurrency][Easy] 1279. Traffic Light Controlled Intersection

Description There is an intersection of two roads. First road is road A where cars travel from North to South in direction 1 and from South to North in direction 2. Second road is road B where cars travel from West to East in direction 3 and from East to West in direction 4. There is a traffic light located on each road before the intersection. A traffic light can either be green or red....

<span title='2022-12-22 03:40:12.749 +0000 UTC'>December 22, 2022</span>&nbsp;·&nbsp;4 分鐘&nbsp;·&nbsp;683 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 2173. Longest Winning Streak

Description Table: Matches +-------------+------+ | Column Name | Type | +-------------+------+ | player_id | int | | match_day | date | | result | enum | +-------------+------+ (player_id, match_day) is the primary key for this table. Each row of this table contains the ID of a player, the day of the match they played, and the result of that match. The result column is an ENUM type of ('Win', 'Draw', 'Lose')....

<span title='2022-12-18 21:45:21.994 +0000 UTC'>December 18, 2022</span>&nbsp;·&nbsp;3 分鐘&nbsp;·&nbsp;436 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 2474. Customers With Strictly Increasing Purchases

Description Table: Orders +--------------+------+ | Column Name | Type | +--------------+------+ | order_id | int | | customer_id | int | | order_date | date | | price | int | +--------------+------+ order_id is the primary key for this table. Each row contains the id of an order, the id of customer that ordered it, the date of the order, and its price. Write an SQL query to report the IDs of the customers with the total purchases strictly increasing yearly....

<span title='2022-12-18 21:30:30.719 +0000 UTC'>December 18, 2022</span>&nbsp;·&nbsp;3 分鐘&nbsp;·&nbsp;549 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 2362. Generate the Invoice

Description Table: Products +-------------+------+ | Column Name | Type | +-------------+------+ | product_id | int | | price | int | +-------------+------+ product_id is the primary key for this table. Each row in this table shows the ID of a product and the price of one unit. Table: Purchases +-------------+------+ | Column Name | Type | +-------------+------+ | invoice_id | int | | product_id | int | | quantity | int | +-------------+------+ (invoice_id, product_id) is the primary key for this table....

<span title='2022-12-18 21:10:22.259 +0000 UTC'>December 18, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;386 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 2199. Finding the Topic of Each Post

Description Table: Keywords +-------------+---------+ | Column Name | Type | +-------------+---------+ | topic_id | int | | word | varchar | +-------------+---------+ (topic_id, word) is the primary key for this table. Each row of this table contains the id of a topic and a word that is used to express this topic. There may be more than one word to express the same topic and one word may be used to express multiple topics....

<span title='2022-12-18 20:54:39.019 +0000 UTC'>December 18, 2022</span>&nbsp;·&nbsp;4 分鐘&nbsp;·&nbsp;700 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 2010. The Number of Seniors and Juniors to Join the Company II

Description Table: Candidates +-------------+------+ | Column Name | Type | +-------------+------+ | employee_id | int | | experience | enum | | salary | int | +-------------+------+ employee_id is the primary key column for this table. experience is an enum with one of the values ('Senior', 'Junior'). Each row of this table indicates the id of a candidate, their monthly salary, and their experience. The salary of each candidate is guaranteed to be unique....

<span title='2022-12-17 00:11:43.958 +0000 UTC'>December 17, 2022</span>&nbsp;·&nbsp;2 分鐘&nbsp;·&nbsp;425 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 2118. Build the Equation

Description Table: Terms +-------------+------+ | Column Name | Type | +-------------+------+ | power | int | | factor | int | +-------------+------+ power is the primary key column for this table. Each row of this table contains information about one term of the equation. power is an integer in the range [0, 100]. factor is an integer in the range [-100, 100] and cannot be zero. You have a very powerful program that can solve any equation of one variable in the world....

<span title='2022-12-16 23:57:37.348 +0000 UTC'>December 16, 2022</span>&nbsp;·&nbsp;3 分鐘&nbsp;·&nbsp;430 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard]2253. Dynamic Unpivoting of a Table

Description Table: Products +-------------+---------+ | Column Name | Type | +-------------+---------+ | product_id | int | | store_name1 | int | | store_name2 | int | | : | int | | : | int | | : | int | | store_namen | int | +-------------+---------+ product_id is the primary key for this table. Each row in this table indicates the product's price in n different stores. If the product is not available in a store, the price will be null in that store's column....

<span title='2022-12-16 21:13:39.338 +0000 UTC'>December 16, 2022</span>&nbsp;·&nbsp;3 分鐘&nbsp;·&nbsp;429 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 1919. Leetcodify Similar Friends

Description Table: Listens +-------------+---------+ | Column Name | Type | +-------------+---------+ | user_id | int | | song_id | int | | day | date | +-------------+---------+ There is no primary key for this table. It may contain duplicates. Each row of this table indicates that the user user_id listened to the song song_id on the day day. Table: Friendship +---------------+---------+ | Column Name | Type | +---------------+---------+ | user1_id | int | | user2_id | int | +---------------+---------+ (user1_id, user2_id) is the primary key for this table....

<span title='2022-12-16 01:08:30.34 +0000 UTC'>December 16, 2022</span>&nbsp;·&nbsp;4 分鐘&nbsp;·&nbsp;642 字&nbsp;·&nbsp;ZhengWei, Liu

[leetcode][Database][Hard] 1917. Leetcodify Friends Recommendations

Description Table: Listens +-------------+---------+ | Column Name | Type | +-------------+---------+ | user_id | int | | song_id | int | | day | date | +-------------+---------+ There is no primary key for this table. It may contain duplicates. Each row of this table indicates that the user user_id listened to the song song_id on the day day. Table: Friendship +---------------+---------+ | Column Name | Type | +---------------+---------+ | user1_id | int | | user2_id | int | +---------------+---------+ (user1_id, user2_id) is the primary key for this table....

<span title='2022-12-15 23:52:20.337 +0000 UTC'>December 15, 2022</span>&nbsp;·&nbsp;3 分鐘&nbsp;·&nbsp;625 字&nbsp;·&nbsp;ZhengWei, Liu