Skip to content

Commit 48849b0

Browse files
committed
add 168 solution
1 parent 4a6f773 commit 48849b0

File tree

1 file changed

+22
-0
lines changed
  • problems/168. Excel Sheet Column Title

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# 168. Excel Sheet Column Title
2+
3+
## #1 除于取余[AC]
4+
5+
### 算法
6+
7+
```java
8+
class Solution {
9+
public String convertToTitle(int n) {
10+
StringBuilder result = new StringBuilder();
11+
12+
while(n>0){
13+
n--;
14+
result.insert(0, (char)('A' + n % 26));
15+
n /= 26;
16+
}
17+
18+
return result.toString();
19+
}
20+
}
21+
```
22+

0 commit comments

Comments
 (0)