📝 Problem

We are given a number target.

We need to find all groups of consecutive positive integers (at least 2 numbers) whose sum is exactly target.


💡 Example 1

target = 12

✅ Output: [[3,4,5]]

Because 3+4+5 = 12.


💡 Example 2

target = 18

✅ Output: [[3,4,5,6],[5,6,7]]

Because:


🎯 Key Idea (Sliding Window)

Think of a window that covers numbers on a number line: