Package g0501_0600.s0504_base_7
Class Solution
- java.lang.Object
-
- g0501_0600.s0504_base_7.Solution
-
public class Solution extends Object
504 - Base 7.Easy
Given an integer
num
, return a string of its base 7 representation.Example 1:
Input: num = 100
Output: “202”
Example 2:
Input: num = -7
Output: “-10”
Constraints:
-107 <= num <= 107
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
-
-
Method Detail
-
convertToBase7
public String convertToBase7(int num)
-
-