-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
### **Base 7 String Representation** | ||
|
||
**Difficulty Level:** 🟢 Beginner | ||
**Domain:** Number Systems and Base Conversions | ||
|
||
### **Objective:** | ||
|
||
Given an integer, return its base 7 **string representation**. | ||
|
||
### **Problem Description:** | ||
|
||
We need to convert a given integer into its base 7 representation. This can be achieved by repeatedly dividing the integer by 7 and recording the remainders. These remainders, when read in reverse order, will provide the base 7 representation. | ||
|
||
### **Input:** | ||
|
||
- A single integer `n` (0 ≤ n ≤ 10^6). | ||
|
||
### **Output:** | ||
|
||
- A string representing the number in base 7. | ||
|
||
### **Example:** | ||
|
||
#### Input: | ||
|
||
```plaintext | ||
100 | ||
``` | ||
|
||
#### Output: | ||
|
||
```plaintext | ||
202 | ||
``` | ||
|
||
### **Note:** | ||
|
||
- If the input number is 0, the output should be "0". | ||
- This problem can be solved using simple arithmetic operations and loops. |