Skip to content

Conversation

@0xSangeet
Copy link

Challenge 2 Solution

Submitted by: @0xSangeet
Challenge: Challenge 2

Description

This PR contains my solution for Challenge 2.

Changes

  • Added solution file to challenge-2/submissions/0xSangeet/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

A new Go solution file is added that implements string reversal. It provides an exported ReverseString function that reverses strings by converting to runes and swapping elements using a two-pointer approach, plus a main function that reads input, processes it, and outputs the result.

Changes

Cohort / File(s) Summary
Challenge 2 String Reversal Solution
challenge-2/submissions/0xSangeet/solution-template.go
Adds ReverseString(s string) string function implementing rune-based in-place string reversal using two-pointer technique; adds main function for reading input and printing reversed output

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #1107: Adds the same exported ReverseString(s string) string implementation in a different challenge-2 submission directory with identical rune-based reversal logic.
  • PR #596: Introduces the same ReverseString function alongside a main function that reads input and prints the reversed string using identical two-pointer rune-slice reversal.
  • PR #1116: Adds an exported ReverseString function with the same rune-based two-pointer reversal logic in a separate challenge-2 submission file.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 summarizes the main change—adding a Challenge 2 solution by a specific contributor.
Description check ✅ Passed The description is directly related to the changeset, providing context about the Challenge 2 submission and solution file.

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