Dsa
Two Pointers
Medium
Pair of Days with Equal Sum
You are given a list of integers representing daily profits and losses. Find the total number of pairs of days (i, j) such that the combined profit/loss for those two days equals a specific target. Each day must be distinct. For example, for the input [1, 2, 3, 4], with target 5, you return 2 because the pairs (1, 4) and (2, 3) meet the condition.
Key concepts
two_pointersarrayssums
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now