Skip to content

Commit b1f0548

Browse files
committed
Upload 162
1 parent 3e00585 commit b1f0548

File tree

3 files changed

+75
-3
lines changed

3 files changed

+75
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,9 @@ Because this project necessitated a framework to enable consistent daily practic
188188
| 157 | [Rearrange Products Table](https://leetcode.com/problems/rearrange-products-table/description/) | [Solution](solutions/157_rearrange_products_table.md) | LeetCode | Easy | |
189189
| 158 | [Calculate Special Bonus](https://leetcode.com/problems/calculate-special-bonus/description/) | [Solution](solutions/158_calculate_special_bonus.md) | LeetCode | Easy | |
190190
| 159 | [The Latest Login in 2020](https://leetcode.com/problems/the-latest-login-in-2020/description/) | [Solution](solutions/159_the_latest_login_in_2020.md) | LeetCode | Easy | |
191-
| 160 | [Employees With Missing Information](https://leetcode.com/problems/employees-with-missing-information/description/) | [Solution](solutions/160_employees_with_missing_information.md) | LeetCode | Easy | FULL JOIN |
191+
| 160 | [Employees With Missing Information](https://leetcode.com/problems/employees-with-missing-information/description/) | [Solution](solutions/160_employees_with_missing_information.md) | LeetCode | Easy | `FULL JOIN` |
192192
| 161 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/description/) | [Solution](solutions/161_delete_duplicate_emails.md) | LeetCode | Easy | |
193+
| 162 | [Find Products with Valid Serial Numbers](https://leetcode.com/problems/find-products-with-valid-serial-numbers/description/) | [Solution](solutions/162_find_products_with_valid_serial_numbers.md) | LeetCode | Easy | Regex |
193194
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
194195
<!--- cSpell:enable --->
195196

eevveerryyddaayy.ipynb

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,32 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": null,
5+
"execution_count": 1,
66
"metadata": {},
7-
"outputs": [],
7+
"outputs": [
8+
{
9+
"data": {
10+
"application/vnd.jupyter.widget-view+json": {
11+
"model_id": "2673fef8a1144aaaa7bd7a5961ae2f62",
12+
"version_major": 2,
13+
"version_minor": 0
14+
},
15+
"text/plain": [
16+
"VBox(children=(VBox(children=(HTML(value='<span style=\"font-size:20px;\"><b>EEVVEERRYYDDAAYY</b></span>', layou…"
17+
]
18+
},
19+
"metadata": {},
20+
"output_type": "display_data"
21+
},
22+
{
23+
"name": "stdout",
24+
"output_type": "stream",
25+
"text": [
26+
"Processing...\n",
27+
"Done\n"
28+
]
29+
}
30+
],
831
"source": [
932
"\"\"\"\n",
1033
"Run this cell to display the form interface.\n",
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SQL Everyday \#162
2+
3+
## Find Products with Valid Serial Numbers
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a solution to find all products whose description *contains a valid serial number pattern*. A valid serial number follows these rules:
11+
12+
* It starts with the letters *SN* (case-sensitive).
13+
* Followed by exactly `4` digits.
14+
* It must have a hyphen *(-) followed by exactly* `4` digits.
15+
16+
The serial number must be within the description (it may not necessarily start at the beginning).
17+
Return the result table ordered by `product_id` in *ascending* order. [[Full Description](https://leetcode.com/problems/find-products-with-valid-serial-numbers/description/)]
18+
19+
## Submitted Solution
20+
21+
```sql
22+
-- Submitted Solution
23+
-- PostgreSQL
24+
SELECT
25+
*
26+
FROM products
27+
WHERE description ~ 'SN[0-9]{4}-[0-9]{4}[^0-9]*$'
28+
ORDER BY product_id ASC
29+
;
30+
```
31+
32+
## Site Solution
33+
34+
```sql
35+
-- LeetCode Solution
36+
-- TBD
37+
```
38+
39+
## Notes
40+
41+
TBD
42+
43+
## NB
44+
45+
Regex
46+
47+
Go to [Index](../?tab=readme-ov-file#index)\
48+
Go to [Overview](../?tab=readme-ov-file)

0 commit comments

Comments
 (0)