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] - Missing Test Case - 3093. Longest Common Suffix Queries #21502

Closed
qz-cqy opened this issue Mar 24, 2024 · 2 comments
Closed

[BUG] - Missing Test Case - 3093. Longest Common Suffix Queries #21502

qz-cqy opened this issue Mar 24, 2024 · 2 comments
Labels

Comments

@qz-cqy
Copy link

qz-cqy commented Mar 24, 2024

LeetCode Username

rui_er

Problem Number, Title, and Link

  1. Longest Common Suffix Queries https://leetcode.com/problems/longest-common-suffix-queries/

Bug Category

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

Bug Description

An accepted solution fails on the following testcase:
3093_testcase.txt

Language Used for Code

Go

Code used for Submit/Run operation

func stringIndices(wordsContainer []string, wordsQuery []string) []int {
    var res []int
    for _, q := range wordsQuery {
        
        maxSuffix := 0
        resIndex := 0
        for i, cand := range wordsContainer {
            suffixLen := calSuffix(q, cand)
            if suffixLen > maxSuffix {
                maxSuffix = suffixLen
                resIndex = i
            } else if suffixLen == maxSuffix {
                if len(wordsContainer[resIndex]) > len(cand) {
                    resIndex = i
                }
            }
        }
        res = append(res, resIndex)
    }
    return res
}

func calSuffix(s, t string) int {
    i, j := len(s)-1, len(t)-1
    cnt := 0
    for i >= 0 && j >= 0 {
        if s[i] == t[j] {
            cnt++
            i--
            j--
        } else {
            break
        }
        
    }
    return cnt
}

Expected behavior

The expected result should be TLE.

Screenshots

image

Additional context

No response

Copy link

Joyce_Ndisya commented: Hello there,

Thank you for reaching out to us.

Your reported issue has been promptly relayed to our dedicated team for thorough investigation. We appreciate your patience and understanding as we work to address and resolve this matter.

Rest assured, we will reach out to you as soon as we have the results and updates regarding the issue.
Once again, thank you for your support and cooperation. If you have any further questions or concerns in the meantime, please feel free to let us know.

Best regards,
LeetCode Support Team

Copy link

Joyce_Ndisya commented: Hello there,

Thank you for your time.

We regret to inform you that we are unable to add the test case at the moment due to technical issues. We apologize for any inconvenience this may cause. Once again, we appreciate your valuable feedback and thank you for your continued support.

If you have any further questions or concerns, please feel free to reach out.

Regards,

Joyce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant