Add solution for Challenge 6 by shansing#1434
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe PR introduces a new Changes
Possibly related PRs
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
challenge-6/submissions/shansing/solution-template.go (1)
24-24: Consider compiling regex at package level for efficiency.
regexp.MustCompileis called on every function invocation. For a challenge solution this is fine, but in production code the compiled regex would typically be a package-level variable to avoid repeated compilation overhead.♻️ Optional refactor
var wordRegex = regexp.MustCompile(`[\w']+`) func CountWordFrequency(text string) map[string]int { countMap := make(map[string]int) words := wordRegex.FindAllString(text, -1) // ... }
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Challenge 6 Solution
Submitted by: @shansing
Challenge: Challenge 6
Description
This PR contains my solution for Challenge 6.
Changes
challenge-6/submissions/shansing/solution-template.goTesting
Thank you for reviewing my submission! 🚀