![JAR search and dependency download from the Maven repository](/logo.png)
g2401_2500.s2469_convert_the_temperature.Solution.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-kotlin Show documentation
Show all versions of leetcode-in-kotlin Show documentation
Kotlin-based LeetCode algorithm problem solutions, regularly updated
package g2401_2500.s2469_convert_the_temperature
// #Easy #Math #2023_07_05_Time_130_ms_(100.00%)_Space_34.6_MB_(57.14%)
class Solution {
fun convertTemperature(celsius: Double): DoubleArray {
val kelvin = celsius + 273.15
val fahrenheit = celsius * 1.80 + 32.00
val arr = DoubleArray(2)
arr[0] = kelvin
arr[1] = fahrenheit
return arr
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy