Loading content...
A product operations team needs to identify catalog entries whose free-text description includes at least one properly formatted serial token.
Table: Products
A serial token is valid only when it matches this exact structure:
Examples:
Task: Return every product whose description contains at least one valid serial token.
Output requirements:
Supported submission environments:
Products:
| product_id | product_name | description |
|------------|--------------|---------------------------------------------------------|
| 1 | Widget A | Includes safety code SN1234-5678 for activation. |
| 2 | Widget B | Legacy note sn1234-5678 appears in old docs. |
| 3 | Widget C | Tracking id SN1234-56789 was mistyped in draft. |
| 4 | Widget D | No serial token appears in this description. |
| 5 | Widget E | Pack contains SN4321-8765 and warranty details. |[
{"product_id":1,"product_name":"Widget A","description":"Includes safety code SN1234-5678 for activation."},
{"product_id":5,"product_name":"Widget E","description":"Pack contains SN4321-8765 and warranty details."}
]Rows 1 and 5 contain an uppercase SN token with exactly 4 digits, a hyphen, and exactly 4 trailing digits not followed by another digit.
Products:
| product_id | product_name | description |
|------------|--------------|-------------------------------------------|
| 10 | Core Kit | Prefix9SN0001-2222 remains valid. |
| 11 | Eco Kit | SN0001-2222 is valid; SN0001-22221 is not |
| 12 | Lite Kit | SN0001/2222 uses wrong separator. |
| 13 | Pro Kit | SN00012-2222 has too many left digits. |[
{"product_id":10,"product_name":"Core Kit","description":"Prefix9SN0001-2222 remains valid."},
{"product_id":11,"product_name":"Eco Kit","description":"SN0001-2222 is valid; SN0001-22221 is not"}
]A digit before SN does not invalidate the token. The strict structure check is applied from the SN start position.
Products:
| product_id | product_name | description |
|------------|--------------|-------------------------------------------------|
| 20 | Unit M | Valid at end SN9000-1000 |
| 21 | Unit N | Multiple tokens: SN1111-2222 then SN3333-4444 |
| 22 | Unit O | Broken forms SN111-2222 and SN1111-222 only |
| 23 | Unit P | Mixed symbols [SN9999-0000] accepted |[
{"product_id":20,"product_name":"Unit M","description":"Valid at end SN9000-1000"},
{"product_id":21,"product_name":"Unit N","description":"Multiple tokens: SN1111-2222 then SN3333-4444"},
{"product_id":23,"product_name":"Unit P","description":"Mixed symbols [SN9999-0000] accepted"}
]Any row with at least one valid token is returned, even if other malformed patterns appear in the same description.
Constraints