The Sum of Its Parts
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
A monitoring export hands you `nums`, a sequence of per-interval integer deltas that can be positive, negative, or zero. Count how many contiguous stretches of `nums` sum to exactly `k`.
Summary
Somewhere in the stream, the deltas balance to your number. Count the runs that do.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.