Base 7

Easy · Math & Number Theory · about 5 minutes

Asked at Google, Amazon, Microsoft.

Return the base-7 representation of the integer num as a string (with a leading '-' for negatives).