168. Excel Sheet Column Title Easy
1/**
2 * [168] Excel Sheet Column Title
3 *
4 * Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet.
5 * For example:
6 *
7 * A -> 1
8 * B -> 2
9 * C -> 3
10 * ...
11 * Z -> 26
12 * AA -> 27
13 * AB -> 28
14 * ...
15 *
16 *
17 * Example 1:
18 *
19 * Input: columnNumber = 1
20 * Output: "A"
21 *
22 * Example 2:
23 *
24 * Input: columnNumber = 28
25 * Output: "AB"
26 *
27 * Example 3:
28 *
29 * Input: columnNumber = 701
30 * Output: "ZY"
31 *
32 *
33 * Constraints:
34 *
35 * 1 <= columnNumber <= 2^31 - 1
36 *
37 */
38pub struct Solution {}
39
40// problem: https://leetcode.com/problems/excel-sheet-column-title/
41// discuss: https://leetcode.com/problems/excel-sheet-column-title/discuss/?currentPage=1&orderBy=most_votes&query=
42
43// submission codes start here
44
45impl Solution {
46 pub fn convert_to_title(column_number: i32) -> String {
47 String::new()
48 }
49}
50
51// submission codes end
52
53#[cfg(test)]
54mod tests {
55 use super::*;
56
57 #[test]
58 fn test_168() {
59 }
60}
61
Back
© 2025 bowen.ge All Rights Reserved.