Skip to content

Missing Test Case - 1527. Patients With a Condition #24371

@MKxuan

Description

@MKxuan

LeetCode 用户名

mkx

问题号码、标题和链接

https://leetcode.cn/problems/patients-with-a-condition/

Bug Category

缺少测试用例 (由于缺少测试用例而接受不正确/低效的代码), 力扣官方题解

描述

测试用例中缺少特殊字符再加上前缀 DIAB1的用例,比如“+DIAB1”。
自测输入如下用例:

| patient_id | patient_name | conditions    |
| ---------- | ------------ | ------------- |
| 1          | George       | ACNE +DIAB100 |
| 2          | Alain        | DIAB201       |

官方题解中的方法 1:使用正则表达式单词边界的方法
即如下解题代码将会错判

SELECT patient_id, patient_name, conditions
FROM Patients
WHERE conditions REGEXP '\\bDIAB1.*';

但用此代码提交却能通过此题,判断题目的测试用例中缺少特殊字符加上前缀的用例,比如“+DIAB1”,导致此错误代码提交可通过

你使用的语言

MySQL

你提交或者运行的代码

No response

期望行为

1.增加特殊字符再加上前缀 DIAB1的用例,比如“+DIAB1”
2.修改官方题解中不能正确判断此种情况的代码

屏幕截图

image

额外的上下文

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions