Problem bank
Problem 242 of 333MediumCodingP242
Count P&L windows summing to k
You are given a list of daily P&L values (integers, possibly negative) and a target . Count the contiguous stretches of days whose total P&L is exactly . For example, with P&L and the answer is 5. Aim for time.
See the hint and solution with a free account
Every problem on Quant Engine is free, with a hint and a full worked solution. Making an account takes 30 seconds and no card. Then you can see them and track what you have solved.