ruby / ruby/prime

#prime_divisors and/or #each_prime_divisor

Open
#21 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
40
Forks
18
Avg merge
5h 52m
Merged PRs (30d)
1

Description

When needed a list of unique divisors (2nd solutinon here), creating (and destructing) a 2D array in prime_division is unnecessary.

Creating an 1D array should be less expensive.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with #prime_divisors and #each_prime_divisor, then trace their use of prime_division. Compare the current 2D-array allocation with the requested 1D representation and verify that both methods preserve their existing divisor results without creating the unnecessary intermediate structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.