Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add `mins` and `maxes` TypeScript goodies

Open
#178 0 comments 0 reactions 0 assignees View on GitHub

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

enhancement typescript

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from code-chronicles-code/leetcode-curriculum

All issues in code-chronicles-code/leetcode-curriculum

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.