Skip to content

Conversation

@dquang0504
Copy link

Challenge 21 Solution

Submitted by: @dquang0504
Challenge: Challenge 21

Description

This PR contains my solution for Challenge 21.

Changes

  • Added solution file to challenge-21/submissions/dquang0504/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 Jan 19, 2026

Walkthrough

Adds a new Go file implementing three binary search utility functions: an iterative version, a recursive variant, and an insertion position finder that returns -1 when targets are not found. Includes a main function demonstrating usage with a sample sorted array.

Changes

Cohort / File(s) Summary
Binary Search Implementation
challenge-21/submissions/dquang0504/solution-template.go
New file with three exported functions: BinarySearch() (iterative), BinarySearchRecursive() (recursive), and FindInsertPosition() (lower_bound insertion index). All not-found cases return -1. Includes demo main function with test outputs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies that this PR adds a solution for Challenge 21 submitted by dquang0504, which directly matches the main purpose of the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining that it contains a solution for Challenge 21 with details about the file added and testing status.

✏️ 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.

❤️ Share

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

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