Skip to content

Add solution for Challenge 3 by murtaza-kgl#1636

Open
murtaza-kgl wants to merge 2 commits into
RezaSi:mainfrom
murtaza-kgl:challenge-3-murtaza-kgl
Open

Add solution for Challenge 3 by murtaza-kgl#1636
murtaza-kgl wants to merge 2 commits into
RezaSi:mainfrom
murtaza-kgl:challenge-3-murtaza-kgl

Conversation

@murtaza-kgl
Copy link
Copy Markdown
Contributor

Challenge 3 Solution

Submitted by: @murtaza-kgl
Challenge: Challenge 3

Description

This PR contains my solution for Challenge 3.

Changes

  • Added solution file to challenge-3/submissions/murtaza-kgl/solution-template.go

Testing

  • Solution passes all test cases
  • Code follows Go best practices

Thank you for reviewing my submission! 🚀

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 84a6d018-aa8c-452e-ab96-33156e072c75

📥 Commits

Reviewing files that changed from the base of the PR and between d062b38 and 9bc6e05.

📒 Files selected for processing (1)
  • challenge-3/submissions/murtaza-kgl/solution-template.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • challenge-3/submissions/murtaza-kgl/solution-template.go

Walkthrough

Adds a new Go solution file introducing Employee and Manager types and methods: AddEmployee, RemoveEmployee, GetAverageSalary, and FindEmployeeByID. Includes a main demonstrating adding, removing, averaging, and finding employees.

Changes

Challenge 3 Solution

Layer / File(s) Summary
Data Shape
challenge-3/submissions/murtaza-kgl/solution-template.go
Adds Employee struct (ID, Name, Age, Salary) and Manager struct (Employees []Employee).
Core Methods
challenge-3/submissions/murtaza-kgl/solution-template.go
Adds (*Manager).AddEmployee, RemoveEmployee (uses slices.IndexFunc and slices.Delete), GetAverageSalary (returns 0.0 for empty), and FindEmployeeByID (returns *Employee or nil).
Wiring / Demo
challenge-3/submissions/murtaza-kgl/solution-template.go, go.mod
Implements main() to instantiate a Manager, add two employees, remove one by ID, print average salary, and print found employee details. go.mod present for module context.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through slices, swift and spry,
I added friends beneath the sky.
Remove a fox, compute the pay,
Find the mate who stayed to stay.
A tiny rabbit cheers: hooray! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a solution for Challenge 3 by a specific contributor.
Description check ✅ Passed The description is clearly related to the changeset, explaining the Challenge 3 solution submission and changes made.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
challenge-3/submissions/murtaza-kgl/solution-template.go (2)

3-3: ⚡ Quick win

Use conventional import formatting.

The semicolon-separated import statement is valid but unconventional. Go style prefers newline-separated imports.

♻️ Conventional import format
-import ("fmt"; "slices")
+import (
+	"fmt"
+	"slices"
+)

43-43: 💤 Low value

Add space before division operator.

Minor formatting: the expression totalSalary /float64(l) should have a space before the / operator for consistency with Go conventions.

♻️ Formatting fix
-	return totalSalary /float64(l)
+	return totalSalary / float64(l)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 33e3c208-f29c-4223-a283-774d51c9e5fb

📥 Commits

Reviewing files that changed from the base of the PR and between bf844ae and d062b38.

📒 Files selected for processing (1)
  • challenge-3/submissions/murtaza-kgl/solution-template.go

Comment thread challenge-3/submissions/murtaza-kgl/solution-template.go
@github-actions
Copy link
Copy Markdown

⚠️ Auto-merge failed

Could not automatically merge this PR: Resource not accessible by integration

A maintainer will need to merge manually.

4 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Auto-merge failed

Could not automatically merge this PR: Resource not accessible by integration

A maintainer will need to merge manually.

@github-actions
Copy link
Copy Markdown

⚠️ Auto-merge failed

Could not automatically merge this PR: Resource not accessible by integration

A maintainer will need to merge manually.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⚠️ Auto-merge failed

Could not automatically merge this PR: Resource not accessible by integration

A maintainer will need to merge manually.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⚠️ Auto-merge failed

Could not automatically merge this PR: Resource not accessible by integration

A maintainer will need to merge manually.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

👋 Action needed for auto-merge

This PR cannot be auto-merged because "Allow edits from maintainers" is enabled. This is a GitHub limitation with automated workflows.

To fix: Please uncheck "Allow edits from maintainers" in the PR sidebar (under the reviewers section), and the PR will be auto-merged in the next cycle.

Alternatively, a maintainer can merge this manually.

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.

1 participant