Skip to content

Conversation

@x890c
Copy link

@x890c x890c commented Jan 18, 2026

Challenge 2 Solution

Submitted by: @x890c
Challenge: Challenge 2

Description

This PR contains my solution for Challenge 2.

Changes

  • Added solution file to challenge-2/submissions/x890c/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 18, 2026

Walkthrough

Adds a new Go submission file that defines ReverseString(s string) string (rune-based reversal) and a main that reads one line from stdin, reverses it, and prints the result.

Changes

Cohort / File(s) Change Summary
New Challenge 2 submission
challenge-2/submissions/x890c/solution-template.go
New file adding public ReverseString(s string) string implemented by converting to runes, reversing the rune slice, and returning the string; includes a main that reads the first stdin line with bufio.Scanner and prints the reversed string.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

🚥 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 and concisely summarizes the main change: adding a solution for Challenge 2 by the contributor x890c.
Description check ✅ Passed The description is well-structured and directly related to the changeset, providing context about the challenge submission, file location, 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.

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

🤖 Fix all issues with AI agents
In `@challenge-2/submissions/x890c/solution-template.go`:
- Around line 24-30: The ReverseString function currently reverses raw bytes
which corrupts multi-byte UTF-8 characters; change it to operate on runes:
convert the input string to a []rune, reverse the rune slice (swap elements from
ends toward the middle) and return string(...) of that rune slice so Unicode
characters are preserved; also fix formatting (add spaces around operators in
the for loop) to satisfy gofmt.

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