Open davidfrtala opened 14 hours ago
LeetCode Support commented: Hello davidfrtala,
Thank you for reaching out regarding the test case in the problem "2461. Maximum Sum of Distinct Subarrays With Length K". After reviewing your report, it seems that there might be a small misunderstanding with the problem requirements. The problem specifically requests finding subarrays of length k
where all elements are distinct. In the provided case, the sequence [1, 2, 3]
is the valid subarray of length 3 that meets these criteria, resulting in a sum of 6
.
I recommend double-checking the problem example explanations and constraints, as they clarify how the distinct condition should be implemented. If you continue to encounter difficulties or have further questions, feel free to reach out. We're here to help!
Best, LeetCode Support Team
LeetCode Username
davidfrtala
Problem Number, Title, and Link
Bug Category
Incorrect test case (Output of test case is incorrect as per the problem statement)
Bug Description
For a given test case
LeetCode expects an output of
6
, however I believe that the answer should be12
.Language Used for Code
JavaScript
Code used for Submit/Run operation
Expected behavior
A Subarray of
[9, 1, 2]
meets the description criteria for a distinct subarray, providing a maximum sum of12
as an output.However, LeetCode suggest output
6
indicating a subarray of[1, 2, 3]
Screenshots
Additional context
No response