apple / apple/swift-algorithms
Unique combinations from a collection
- Dominant language
- Swift
- Stars
- 6.3k
- Forks
- 483
- PR merge metrics
- No merged PRs in 30d
Description
I noticed there’s a method for counting the unique permutations of a collection - how come there is no equivalent for combinations? For example the unique combinations of length 2 of “aabc” are “aa”, “ab”, “ac”, “bc”. If others think this would be useful Id be interested in trying to implement it !
An equivalent would be `more_itertools.distinct_combinations(collection, k)` in Python
Contributor guide
Research direction
Locate the existing method for counting unique permutations in the Swift Algorithms repository and inspect its related tests. Compare the requested behavior with Python's distinct_combinations(collection, k), including the “aabc” length-2 example; done means the equivalent combinations operation is implemented and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100