You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Missing test case (Incorrect/Inefficient Code getting accepted because of missing test cases)
Bug Description
For this problem, I submitted the attached solution and it was accepted, then I found case when it should fail.
When s = "abcccccdddd", the expected output is 3, but the returned value was 1. You need to add such test to make it stronger!
Language Used for Code
C++
Code used for Submit/Run operation
class Solution {
public:
int maximumLength(string s) {
int n = s.size();
vector<vector<int>> freq(26, vector<int>(3, -1));
int cur = 0, ans = -1;
char prev = s[0];for (auto &c : s) {
if (c == prev) {
++cur;
}
else {
cur = 1;
prev = cur;
}
auto it = min_element(freq[c - 'a'].begin(), freq[c - 'a'].end());if (cur >*it) {
// cout <<"before: " << *it << endl; *it = cur; // cout << "after: " << *it << endl; } } for (int i = 0; i < 26; ++i) { ans = max(ans, *min_element(freq[i].begin(), freq[i].end())); } return ans; }};
Expected behavior
Expected result 3, but the output was 1!
Screenshots
Additional context
No response
The text was updated successfully, but these errors were encountered:
Thank you for contributing to LeetCode and submitting a missing test case. Upon review, we found that your code indeed failed as expected. This may have resulted from a recent update where similar test cases were integrated into our system, which now accurately detects the issues in your submission.
If you would like to resubmit your code for further review or if you have any additional questions, please feel free to reply to this message or open a new issue with us.
Thank you for your engagement and for helping us improve our platform.
LeetCode Username
karygauss03
Problem Number, Title, and Link
https://leetcode.com/problems/find-longest-special-substring-that-occurs-thrice-i
Bug Category
Missing test case (Incorrect/Inefficient Code getting accepted because of missing test cases)
Bug Description
For this problem, I submitted the attached solution and it was accepted, then I found case when it should fail.
When s = "abcccccdddd", the expected output is 3, but the returned value was 1. You need to add such test to make it stronger!
Language Used for Code
C++
Code used for Submit/Run operation
Expected behavior
Expected result 3, but the output was 1!
Screenshots
Additional context
No response
The text was updated successfully, but these errors were encountered: