π
Number to String
Number to Stringμ
λ¬Έ κΈ°μ΄ λ¬Έλ² +5pts
Problem
Write a function that converts a number to a string.
Examples
Input:
numToString(123)Output:
"123"Explanation
μ΄ λ¬Έμ λ **νμ λ³ν(Type Conversion)**μ νμ΅ν©λλ€. μ«μλ₯Ό λ¬Έμμ΄λ‘ λ³ννλ μ¬λ¬ λ°©λ²μ μμλ΄ λλ€. **String() ν¨μ** μ΄λ€ κ°μ΄λ λ¬Έμμ΄λ‘ λ³νν©λλ€: - String(123) β "123" - String(true) β "true" - String(null) β "null" **toString() λ©μλ** μ«μ κ°μ μ§μ νΈμΆν μ μμ΅λλ€: - (123).toString() β "123" - num.toString() β "123" **ν νλ¦Ώ 리ν°λ΄** λΉ ν νλ¦Ώμ λ£μ΄λ λ¬Έμμ΄μ΄ λ©λλ€...
View detailed explanation βKey Concepts
String() ν¨μ toString() λ©μλ νμ
λ³ν μ§λ² λ³ν
Time: O(log n) Space: O(log n)
solution.js
Ctrl + Enter
Run tests to see results here.