Convert the Temperature - 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
Input & Output
Example 1 — Basic Case
$
Input:
celsius = 36.50
›
Output:
[309.65, 97.70]
💡 Note:
Kelvin = 36.50 + 273.15 = 309.65, Fahrenheit = 36.50 × 1.80 + 32.00 = 97.70
Example 2 — Zero Degrees
$
Input:
celsius = 122.11
›
Output:
[395.26, 251.798]
💡 Note:
Kelvin = 122.11 + 273.15 = 395.26, Fahrenheit = 122.11 × 1.80 + 32.00 = 251.798
Example 3 — Freezing Point
$
Input:
celsius = 0.00
›
Output:
[273.15, 32.00]
💡 Note:
At freezing point: Kelvin = 0 + 273.15 = 273.15, Fahrenheit = 0 × 1.80 + 32 = 32.00
Constraints
- 0 ≤ celsius ≤ 1000
Visualization
Tap to expand
Understanding the Visualization
1
Input
Celsius temperature value
2
Process
Apply conversion formulas
3
Output
Array with Kelvin and Fahrenheit values
Key Takeaway
🎯 Key Insight: Direct formula application - no complex algorithms needed
💡
Explanation
AI Ready
💡 Suggestion
Tab
to accept
Esc
to dismiss
// Output will appear here after running code