Reported interview periodMar 2026–Aug 2026
Count contiguous runs with a target sum
Given an integer array and a target, count the non-empty contiguous runs whose values add up to that target. Values may be zero or negative, so a qualifying run can begin and end anywhere.
Practice focusRequirements - The first line holds the element count and the target, separated by a space; the second line holds the values. - A variant layout puts only the count on the first line, the values on the second, and the target on the third; read the target from whichever position it occupies. - Count every start and end pair, including single elements and runs whose values are all zero. - The empty run never counts, and overlapping runs are counted separately. - Return the count as a decimal string with no other text.…