Integer to Base 3
Given an integer n
, return its base 3
representation as a string.
Constraints
0 ≤ n < 2 ** 31
https://binarysearch.com/problems/Integer-to-Base-3
Examples
Example 1
Input
- n =
7
Output
- answer =
21
Example 2
Input
- n =
11
Output
- answer =
102
Leave a comment