Search⌘ K
AI Features

Solution: Base 7

Understand how to convert a decimal integer to base 7 by dividing the number repeatedly by 7 and collecting remainders. Learn to handle negative numbers and zero, and explore the time and space complexities of this method. This lesson helps you master base conversion techniques commonly tested in coding interviews.

Statement

Given an integer num, return a string representing its base 77 equivalent.

Constraints:

  • 107-10^7 \leq num 107\leq 10^7 ...