The classic "include or exclude" DP pattern. This recurrence (take current + skip previous, or skip current) appears in many DP problems.
Enable JavaScript for the full StreamPrep guide.