🔗 Maximum Length of Pair Chain

Greedy Algorithm Visualization

📝 Custom Input

Quick Examples:
Current Input: [[1,2],[2,3],[3,4]] Expected Output: 2
Available Pair
Current Pair
Selected Pair
Rejected Pair
Sorted Pairs (by ending value)
Pairs on Number Line
Current Chain
Step 0 of 0

Step 0: Ready to Start

Use the Next button to step through the greedy algorithm, or Previous to go back.

📊 Algorithm State

Current Index: 0
Chain Length: 0
Last End: None
Pairs Count: 3

📝 Problem Info

Total Pairs: 3

Algorithm Type: Greedy

Approach: Sort by end value

Time Complexity: O(n log n)

Space Complexity: O(1)