LeetCode-Feedback / LeetCode-Feedback

664 stars 317 forks source link

Missing Test Case - 2215. Find the Difference of Two Arrays #19248

Closed iaPlotnikovv closed 8 months ago

iaPlotnikovv commented 8 months ago

LeetCode Username

Doffix

Problem number, title, and link

  1. 2215. Find the Difference of Two Arrays

Category of the bug

Description of the bug

Description says "Note that the integers in the lists may be returned in any order." but actually I got wrong answer

Language used for code

Go

Code used for Submit/Run operation

func findDifference(nums1 []int, nums2 []int) [][]int {
    a := make([][]int, 2)
    n := make(map[int]int)

    for i := range nums1 {
        n[nums1[i]] = 1
    }

    for i := range nums2 {

        if _, ok := n[nums2[i]]; !ok {

            a[1] = append(a[1], nums2[i])
        } else {
            n[nums2[i]]++
        }
    }

    for k, v := range n {

        if v == 1 {
            a[0] = append(a[0], k)
        }

    }
    return a
}

Expected behavior

Accepted task

Screenshots

Screenshot from 2024-01-10 14-39-19

Screenshot from 2024-01-10 14-36-08

Additional context

LC-Pam commented 8 months ago

Dear user,

Thank you for submitting your code to our platform. After a thorough evaluation, we regret to inform you that your code did not produce the expected results. Our code judge is functioning correctly, and we have verified the correctness of our evaluation process.

We kindly suggest that you review your code carefully and ensure it adheres to the problem requirements and constraints. It may be beneficial to double-check your logic, algorithm implementation, and any potential errors or corner cases that could affect the code's performance.

Additionally, we encourage you to explore our discussion board, where you can seek assistance from the community. Many experienced users and experts are available to help troubleshoot issues, provide insights, and offer guidance on improving your code.

We believe that by reviewing your code and actively engaging with the community, you will have a better chance of identifying and resolving the discrepancies. Remember, learning from such experiences and iterating on your code is an essential part of the programming journey.

We appreciate your understanding and encourage you to continue learning and improving your coding skills.

Should you have any further questions or need additional support, please don't hesitate to reach out to us.

Best regards,

The LeetCode Team