Skip to content

Commit b2f838a

Browse files
committed
Add solution #2469
1 parent 6d748c2 commit b2f838a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

2469-convert-the-temperature.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* 2469. Convert the Temperature
3+
* https://leetcode.com/problems/convert-the-temperature/
4+
* Difficulty: Easy
5+
*
6+
* You are given a non-negative floating point number rounded to two decimal places celsius,
7+
* that denotes the temperature in Celsius.
8+
*
9+
* You should convert Celsius into Kelvin and Fahrenheit and return it as an array
10+
* ans = [kelvin, fahrenheit].
11+
*
12+
* Return the array ans. Answers within 10-5 of the actual answer will be accepted.
13+
*/
14+
15+
/**
16+
* @param {number} celsius
17+
* @return {number[]}
18+
*/
19+
var convertTemperature = function(celsius) {
20+
return [celsius + 273.15, celsius * 1.80 + 32];
21+
};

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@
299299
2154|[Keep Multiplying Found Values by Two](./2154-keep-multiplying-found-values-by-two.js)|Easy|
300300
2244|[Minimum Rounds to Complete All Tasks](./2244-minimum-rounds-to-complete-all-tasks.js)|Medium|
301301
2427|[Number of Common Factors](./2427-number-of-common-factors.js)|Easy|
302+
2469|[Convert the Temperature](./2469-convert-the-temperature.js)|Easy|
302303

303304
## License
304305

0 commit comments

Comments
 (0)