Add `mins` and `maxes` TypeScript goodies
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start by locating Iterator.prototype.min and Iterator.prototype.max, then read the BinaryHeap and compareNatural goodies. Consider the proposed Iterator.prototype.mins and Iterator.prototype.maxes names and how the comparator would be handled for each. Done means both proposed goodies work for multiple minima or maxima; NaN behavior can remain outside the initial scope.
Written by the indexing model from the issue text.
Description
The Ruby min and max methods allow specifying an argument, to get more than one minimum or maximum. I think it'd be fun to add a goody for this, but rather than modifying Iterator.prototype.min and/or Iterator.prototype.max, I think we should have new goodies for this, since it's a somewhat niche need.
I'm proposing Iterator.prototype.mins and Iterator.prototype.maxes as the names for these, although other suggestions are welcome.
For the implementation, BinaryHeap would be fun to use. It will be easiest to start with .maxes (since the default behavior of the heap is as a min-heap, and we can use compareNatural goody as the default comparator). For .mins, it will be necessary to come up with a way to reverse the comparator.
Additional note: min and max handle NaN specially. We can skip that behavior to start with for .mins and .maxes, and come back to it later.
- Dominant language
- TypeScript
- Stars
- 20
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from code-chronicles-code/leetcode-curriculum
-
enhancement kotlin
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
good first issue tests
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
-
good first issue tests
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
good first issue tests
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
code-chronicles-code/leetcode-curriculum#418 · 1 comment ·
All issues in code-chronicles-code/leetcode-curriculum
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
AOSSIE-Org/DebateAI#582 · 2 comments ·