Skip to content

feat(two-bucket): add BFS and Extended GCD approaches for W39 48in24 - #331

Open
haaeppyy wants to merge 10 commits into
exercism:mainfrom
haaeppyy:added-approach-to-twobucket
Open

haaeppyy wants to merge 10 commits into
exercism:mainfrom
haaeppyy:added-approach-to-twobucket

Conversation

@haaeppyy

@haaeppyy haaeppyy commented Oct 5, 2026 •

Copy link
Copy Markdown

tag: #221
What this PR does:
Adds .approaches folder for the two-bucket exercise to enable the "Dig Deeper" feature for W39 #48in24, as requested in the issue.
Approaches added:

  1. Breadth-First Search — state-space search (matches example solution)
  2. Extended GCD — mathematical approach using Extended Euclidean Algorithm
    Files:
  • .approaches/config.json — metadata with UUIDs, slugs, blurbs
  • .approaches/introduction.md — overview with trade-offs
  • .approaches/bfs/content.md + snippet.txt (8 lines)
  • .approaches/egcd/content.md + snippet.txt (8 lines)
    Notes:
  • First exercise in V track with approaches — follows Exercism standard format (referenced Go track examples)
  • Snippets ≤8 lines per Exercism requirements
  • Ready for W39 feature
  • Add .approaches/config.json with metadata for both approaches
  • Add .approaches/introduction.md with overview and trade-offs
  • Add .approaches/bfs/content.md with detailed BFS explanation
  • Add .approaches/bfs/snippet.txt with core BFS logic (8 lines)
  • Add .approaches/egcd/content.md with Extended GCD mathematical approach
  • Add .approaches/egcd/snippet.txt with egcd implementation (8 lines)

- Add .approaches/config.json with metadata for both approaches
- Add .approaches/introduction.md with overview and trade-offs
- Add .approaches/bfs/content.md with detailed BFS explanation
- Add .approaches/bfs/snippet.txt with core BFS logic (8 lines)
- Add .approaches/egcd/content.md with Extended GCD mathematical approach
- Add .approaches/egcd/snippet.txt with egcd implementation (8 lines)
Copilot AI balanced review requested due to automatic review settings October 5, 2026 21:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@keiravillekode

Copy link
Copy Markdown
Contributor

Have you solved this exercise in Exercism using these two approaches, and published the solutions?

i.e. do they appear in Community Solutions?

I think it would be helpful if each approach content.md started with a full working code example. As far as I can tell, that is what every Go approach does.

@keiravillekode

Copy link
Copy Markdown
Contributor

Please run

bin/fetch-configlet
bin/configlet lint

@keiravillekode

Copy link
Copy Markdown
Contributor

bfs/content.md should begin with a full working solution, like egcd/content.md does.

Comment thread exercises/practice/two-bucket/.approaches/introduction.md Outdated
Comment thread exercises/practice/two-bucket/.approaches/introduction.md Outdated
Comment thread exercises/practice/two-bucket/.approaches/bfs/content.md
Comment thread exercises/practice/two-bucket/.approaches/egcd/content.md
Comment thread exercises/practice/two-bucket/.approaches/config.json Outdated
Comment thread exercises/practice/two-bucket/.approaches/bfs/content.md Outdated
Comment thread exercises/practice/two-bucket/.approaches/bfs/content.md Outdated

@kahgoh kahgoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A number of the markdown and snippet.txt files are failing the CI because they are missing the new lines at the end of file. See https://github.com/exercism/vlang/actions/runs/38356430524/job/116427418012#step:4:195

Example with buckets 3 and 5, start bucket one, (0,5) excluded:
```
Initial: queue=[(3,0)], front=0, old_back=1, moves=1
Process (3,0): adds (0,3), (0,0), (3,5) -- queue length is 4

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more --

Suggested change
Process (3,0): adds (0,3), (0,0), (3,5) -- queue length is 4
Process (3,0): adds (0,3), (0,0), (3,5) -> queue length is 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants