Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Better test cases for Remove Duplicates from Sorted Array exercise #22170

Closed
JandroCastro opened this issue May 8, 2024 · 1 comment

Comments

@JandroCastro
Copy link

LeetCode Username

JandroCastro

Problem Number, Title, and Link

  1. Remove Duplicates from Sorted Array https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/?envType=study-plan-v2&envId=top-interview-150

Bug Category

Missing test case (Incorrect/Inefficient Code getting accepted because of missing test cases)

Bug Description

Hi Team, i think there are problems with these testcase, i have a solution that pass all your test cases but if i run the script with another entry array, my script is incorrect.

Capt 1 with your test cases:

Screenshot 2024-05-08 at 12 12 22

Capt 2 with another test case: the returned value is incorrect, if script works in the way you ask us in the description, r.length should be 15 but is 6:

Screenshot 2024-05-08 at 12 14 18

Language Used for Code

JavaScript

Code used for Submit/Run operation

var removeDuplicates = function(nums) {
    let r = [];
    let k = 0

    for (let i = 0; i < nums.length; i++) {
    const element = nums[i];
    if(element === r[r.length -1])  {
        nums.splice(i,1)
        i--
    }
    else {
        r.push(element)
    }
}
};

Expected behavior

Test cases should be more especifics, they should be more complex

Screenshots

No response

Additional context

No response

@JandroCastro JandroCastro changed the title [BUG] - <title> [BUG] - Better test cases for Remove Duplicates from Sorted Array exercise May 8, 2024
@exalate-issue-sync exalate-issue-sync bot changed the title [BUG] - Better test cases for Remove Duplicates from Sorted Array exercise [BUG] - <title> May 8, 2024
Copy link

Winston Tang commented: Hi JandroCastro,

Thank you for reaching out to us and for your active contribution to our platform. We're sorry to hear that you're experiencing some issues with the test cases of problem 26.

To investigate this issue further, we need a few more details. Could you please provide us with the specific test case where you believe your code should have failed but it got accepted? Along with this, more about why you believe the test case reveals a problem with the current suite of tests would be useful.

Your active involvement helps us to continuously improve our platform and provide the best resources to our users.

Thank you for your understanding and cooperation.

Best Regards,
LeetCode Support Team

@exalate-issue-sync exalate-issue-sync bot changed the title [BUG] - <title> [BUG] - Better test cases for Remove Duplicates from Sorted Array exercise May 8, 2024
@exalate-issue-sync exalate-issue-sync bot reopened this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant