-
-
Notifications
You must be signed in to change notification settings - Fork 630
Add solution for Challenge 22 by Be1chenok #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds a new Go program with greedy coin-change logic, exposing MinCoins and CoinCombination functions, plus a main function demonstrating usage with sample denominations and amounts. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant main as main()
participant GC as GreedyChange
participant Out as Console
User->>main: Run program
main->>GC: MinCoins(amount, denominations)
GC-->>main: minCoinCount or -1
main->>GC: CoinCombination(amount, denominations)
GC-->>main: map[denomination]count
main->>Out: Print results per amount
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
challenge-22/submissions/Be1chenok/solution-template.go (1)
36-36
: Rungofmt
for consistent formatting.The code has inconsistent spacing (e.g.,
for i:=len(denominations)-1;i>=0;i--{
should have spaces around operators). Additionally, consider renamingcntNums
to something more descriptive likecoinCounts
.Run the following command to format the code:
#!/bin/bash # Format the Go code gofmt -w challenge-22/submissions/Be1chenok/solution-template.goAlso applies to: 54-54
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
challenge-22/submissions/Be1chenok/solution-template.go
(1 hunks)
🔇 Additional comments (1)
challenge-22/submissions/Be1chenok/solution-template.go (1)
7-27
: LGTM!The demonstration code is clear and appropriately exercises both functions with standard US denominations.
Challenge 22 Solution
Submitted by: @Be1chenok
Challenge: Challenge 22
Description
This PR contains my solution for Challenge 22.
Changes
challenge-22/submissions/Be1chenok/solution-template.go
Testing
Thank you for reviewing my submission! 🚀