Base 7

Given an integer num, return a string of its base 7 representation.

Example 1
Inputnum = 100
Output"202"
The decimal number 100 is represented as 202 in base 7.
Example 2
Inputnum = -7
Output"-10"
The decimal number -7 is represented as -10 in base 7.

Constraints

  • -10^7 <= num <= 10^7

Asked at 4 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate