Skip to content

Conversation

@iamsurajmandal
Copy link
Contributor

Challenge 21 Solution

Submitted by: @iamsurajmandal
Challenge: Challenge 21

Description

This PR contains my solution for Challenge 21.

Changes

  • Added solution file to challenge-21/submissions/iamsurajmandal/solution-template.go

Testing

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

Thank you for reviewing my submission! 🚀

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

A new Go file containing three binary search utility functions is added: iterative BinarySearch, recursive BinarySearchRecursive, and FindInsertPosition. A main function demonstrates usage of all three functions with example data and printed results.

Changes

Cohort / File(s) Summary
Binary search implementations
challenge-21/submissions/iamsurajmandal/solution-template.go
Added iterative and recursive binary search functions, plus insert position finder; includes main function demonstrating all three search utilities on sample sorted array

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review correctness of binary search logic in both iterative and recursive implementations
  • Investigate the noted out-of-bounds risk in BinarySearchRecursive (mid computation before boundary check)
  • Verify FindInsertPosition logic for maintaining sorted order
  • Validate main function examples execute as intended

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies this as a Challenge 21 solution submission by a specific contributor, accurately reflecting the main change of adding a solution file.
Description check ✅ Passed The description is well-related to the changeset, explaining the challenge submission, listing the specific file added, and confirming testing completion.

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

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

Copy link
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 (1)
challenge-21/submissions/iamsurajmandal/solution-template.go (1)

29-65: Remove stale TODO markers.

The BinarySearch and BinarySearchRecursive bodies are already implemented, so the // TODO: Implement this function comments are now misleading—please drop them to avoid confusion for future readers.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b39f4a and f604005.

📒 Files selected for processing (1)
  • challenge-21/submissions/iamsurajmandal/solution-template.go (1 hunks)

@RezaSi RezaSi merged commit b1ead9d into RezaSi:main Nov 8, 2025
5 checks passed
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.

2 participants