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
Temperature Conversion ProcessInput36.50°CConversion FormulasK = C + 273.15F = C × 1.80 + 32Apply both formulasOutput[309.65, 97.7]36.50 + 273.15 = 309.65 K36.50 × 1.80 + 32 = 97.70 FResult: [309.65, 97.70]
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
Asked in
Google 25 Microsoft 20
21.4K Views
Low Frequency
~5 min Avg. Time
856 Likes
Ln 1, Col 1
Smart Actions
💡 Explanation
AI Ready
💡 Suggestion Tab to accept Esc to dismiss
// Output will appear here after running code
Code Editor Closed
Click the red button to reopen