Loading...
The Subarray Tally
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid, senior
Problem
A financial analytics tool counts how many contiguous sub-sequences of daily returns sum to exactly a target value. Write a function that takes a list of integers and a target integer k, and returns the number of contiguous subarrays whose values sum to exactly k.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.