Skip to content

Add solution for Challenge 18 by sreehari-k-19#1751

Open
sreehari-k-19 wants to merge 1 commit into
RezaSi:mainfrom
sreehari-k-19:challenge-18-sreehari-k-19
Open

Add solution for Challenge 18 by sreehari-k-19#1751
sreehari-k-19 wants to merge 1 commit into
RezaSi:mainfrom
sreehari-k-19:challenge-18-sreehari-k-19

Conversation

@sreehari-k-19
Copy link
Copy Markdown
Contributor

Challenge 18 Solution

Submitted by: @sreehari-k-19
Challenge: Challenge 18

Description

This PR contains my solution for Challenge 18.

Changes

  • Added solution file to challenge-18/submissions/sreehari-k-19/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 May 30, 2026

Review Change Stack

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: baea09f7-3aaa-438a-8567-598b26094a20

📥 Commits

Reviewing files that changed from the base of the PR and between aa037e3 and 54cf5ed.

📒 Files selected for processing (1)
  • challenge-18/submissions/sreehari-k-19/solution-template.go

Walkthrough

This PR adds a Go solution for Challenge 18 that implements temperature conversions between Celsius and Fahrenheit. The solution includes two conversion functions that apply standard formulas, a shared rounding utility to format results to two decimal places, and a main function that demonstrates the conversions.

Changes

Temperature Conversion Implementation

Layer / File(s) Summary
Conversion functions and rounding helper
challenge-18/submissions/sreehari-k-19/solution-template.go
CelsiusToFahrenheit and FahrenheitToCelsius functions apply standard temperature formulas and round results to two decimals via a shared Round helper that uses math.Pow10 and math.Round. A main entry point demonstrates both conversions on example inputs and prints formatted results.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • RezaSi/go-interview-practice#610: Both PRs add Go temperature-conversion utilities for Challenge 18, including the same CelsiusToFahrenheit, FahrenheitToCelsius, and shared Round helper logic with two-decimal rounding.
  • RezaSi/go-interview-practice#881: Both PRs add the same Challenge 18 temperature conversion functions (CelsiusToFahrenheit, FahrenheitToCelsius) and a shared Round helper in solution-template.go with a demo main.
  • RezaSi/go-interview-practice#754: Both PRs add the same Challenge 18 Go temperature conversion functions (CelsiusToFahrenheit, FahrenheitToCelsius) and shared Round helper in their respective solution-template.go files.

Poem

🐰 A rabbit converts with flair,
From Celsius to Fahrenheit in the air!
With Round helper true, two decimals precise,
Temperature changes, crisp and nice.
Challenge eighteen: solved with grace! 🌡️

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a solution submission for Challenge 18 by a specific contributor.
Description check ✅ Passed The description is directly related to the changeset, providing context about the Challenge 18 submission, the file location, and testing verification.
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.12.2)

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

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