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

Add a `partition` goody

Open
#115 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
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
tooling

Research direction

Start by locating Iterator.prototype and reviewing the existing goodies attached to it. Resolve whether partition should return two arrays or two iterators, then implement the selected behavior and add coverage showing that an iterator can be partitioned into the two expected results.

Written by the indexing model from the issue text.

Description

enhancement typescript

Inspiration from Ruby: https://rubydoc.info/stdlib/core/Enumerable:partition

A reasonable place for it to live would be on Iterator.prototype, then anything that can give us an iterator can also be partitioned.

Should we return two arrays like Ruby does or two iterators? I'm currently thinking that two arrays is fine. Two iterators would only be better if these iterators are lazy, but that doesn't seem worth the overhead currently.

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.