504. Base 7 Easy

@problem@discussion
#Math



1/**
2 * [504] Base 7
3 *
4 * Given an integer num, return a string of its base 7 representation.
5 *  
6 * Example 1:
7 * Input: num = 100
8 * Output: "202"
9 * Example 2:
10 * Input: num = -7
11 * Output: "-10"
12 *  
13 * Constraints:
14 * 
15 * 	-10^7 <= num <= 10^7
16 * 
17 */
18pub struct Solution {}
19
20// problem: https://leetcode.com/problems/base-7/
21// discuss: https://leetcode.com/problems/base-7/discuss/?currentPage=1&orderBy=most_votes&query=
22
23// submission codes start here
24
25impl Solution {
26    pub fn convert_to_base7(num: i32) -> String {
27        String::new()
28    }
29}
30
31// submission codes end
32
33#[cfg(test)]
34mod tests {
35    use super::*;
36
37    #[test]
38    fn test_504() {
39    }
40}
41


Back
© 2025 bowen.ge All Rights Reserved.