Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/emilwijayasekara/leetcode-2469-convert-the-temperature

LeetCode Problem 2469. Convert the Temperature - This problem entails converting a Celsius temperature to its corresponding values in Kelvin and Fahrenheit, utilizing precise conversion formulas, and returning the results in a two-element array with specified precision.
https://github.com/emilwijayasekara/leetcode-2469-convert-the-temperature

java leetcode leetcode-java leetcode-solutions

Last synced: 2 days ago
JSON representation

LeetCode Problem 2469. Convert the Temperature - This problem entails converting a Celsius temperature to its corresponding values in Kelvin and Fahrenheit, utilizing precise conversion formulas, and returning the results in a two-element array with specified precision.

Awesome Lists containing this project

README

        

# LeetCode Practice (Day 12)

## About the problem
- *Problem Number* : 2469
- *Problem Name* : [Convert the Temperature](https://leetcode.com/problems/convert-the-temperature/description/ "https://leetcode.com/problems/convert-the-temperature/description/")
- *Problem difficulty* : Easy (88.75%)🟢
- *Programming language used* - Java

## Problem

You are given a non-negative floating point number rounded to two decimal places `celsius`, that denotes the **temperature in Celsius**.

You should convert Celsius into **Kelvin** and **Fahrenheit** and return it as an array `ans = [kelvin, fahrenheit]`.

Return _the array `ans`._ Answers within `10-5` of the actual answer will be accepted.

**Note that:**

- `Kelvin = Celsius + 273.15`
- `Fahrenheit = Celsius * 1.80 + 32.00`

**Example 1:**

```
Input: celsius = 36.50
Output: [309.65000,97.70000]
Explanation: Temperature at 36.50 Celsius converted in Kelvin is 309.65 and converted in Fahrenheit is 97.70.
```

**Example 2:**

```
Input: celsius = 122.11
Output: [395.26000,251.79800]
Explanation: Temperature at 122.11 Celsius converted in Kelvin is 395.26 and converted in Fahrenheit is 251.798.
```

**Constraints:**

- `0 <= celsius <= 1000`

## Approach Explanation

This is just .... 😂

### If you have suggestions for improvement or would like to contribute to this solution, feel free to create a pull request. 🙌😇