apple / apple/swift-algorithms
Add a method to strip duplicate values from already-sorted sequences.
- Dominant language
- Swift
- Stars
- 6.3k
- Forks
- 483
- PR merge metrics
- No merged PRs in 30d
Description
I'm writing a `Set`-like type. Each value can be in the set only once. I'm adding an initializer that will read all elements at once to perfectly build the internal binary tree in advance. Instead of worrying about removing duplicates while building the tree, it'd be better to remove all duplicates, ensuring a possibly non-decreasing sequence is a strictly-increasing one.
See pull request #257 for a sample implementation.
Contributor guide
Research direction
Start by reading pull request #257, which contains a sample implementation, and inspect the existing sorted-sequence algorithms it targets. Done means a method removes duplicate values from a possibly non-decreasing sequence so the result is strictly increasing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100