Greedy Algorithms8 sections · 316 units
Open in Course

Quiz: Wiggle Subsequence

Why this greedy works

Check Your Understanding

Why does counting peaks and valleys give the longest wiggle subsequence?

  1. A.Peaks and valleys are easy to count
  2. B.Peaks and valleys represent direction changes, which maximize wiggle length
  3. C.Every wiggle subsequence must include all peaks and valleys
  4. D.It is a coincidence that works for this problem
Start the roadmap to answer the quizzes and solve the challenges