Skip to content

Commit

Permalink
Temperatures
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesfranciscodev committed Oct 18, 2024
1 parent 15da13b commit b3883bd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions puzzles/ruby/temperatures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ The challenge consists of writing a program that takes as input the list of temp

## Solution Overview

The algorithm processes a list of integer temperatures to find the one closest to zero. Here's a step-by-step breakdown:

1. **Read Input**: It first reads the number of temperatures and the temperatures themselves from standard input. The temperatures are converted into an array of integers.

2. **Initialize Variables**

3. **Iterate Over Temperatures**

4. **Output the Result**
The solution to this challenge involves iterating over the list of temperatures and keeping track of the absolute difference between each temperature and zero. The closest temperature to zero is the one with the smallest absolute difference. If there are two temperatures with the same absolute difference, the solution should output the positive one.

## Example Input/Output

Expand Down

0 comments on commit b3883bd

Please sign in to comment.