Open 00RohitRoshan opened 2 hours ago
LeetCode Support commented: Hello rohitroshanjena2017,
Thank you for reaching out about the issue with the "Continuous Subarray Sum" problem. From your description, it seems there might be a slight misunderstanding related to the problem's definition of a "good subarray." According to the problem statement, a valid subarray must be of at least length two, and its sum must be a multiple of k. Importantly, 0 is considered a multiple of any integer due to the property that any number multiplied by zero remains zero.
Given the test case [5,0,0,0] with k=3, the subarray [0,0] satisfies the condition as its sum is 0, which is a multiple of 3. This is why the output is true. We recommend revisiting the problem statement and considering how subarrays containing zeros can affect the outcome.
If you have any further questions or need more clarification, please feel free to ask. We're here to help!
Best regards, LeetCode Support Team
LeetCode Username
rohitroshanjena2017
Problem Number, Title, and Link
https://leetcode.com/problems/continuous-subarray-sum/
Bug Category
Incorrect test case (Output of test case is incorrect as per the problem statement)
Bug Description
[5,0,0,0] 3
5 is not a multiple of 3 but it expects true
Language Used for Code
C++
Code used for Submit/Run operation