mirror of
https://github.com/arkorty/LeetCode.git
synced 2026-03-17 16:51:46 +00:00
Refactor almost everything
This commit is contained in:
@@ -2,9 +2,8 @@ class Solution {
|
||||
public String convertToTitle(int num) {
|
||||
StringBuilder ttl = new StringBuilder();
|
||||
|
||||
while (num > 0) {
|
||||
--num;
|
||||
char tba = (char) (num % 26 + 65);
|
||||
while (num-- > 0) {
|
||||
char tba = (char)(num % 26 + 65);
|
||||
ttl.insert(0, tba);
|
||||
num /= 26;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user