Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20a62bf

Browse files
authored
Create 0168-excel-sheet-column-title.kt
1 parent114b7c5 commit20a62bf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
classSolution {
2+
funconvertToTitle(_cN:Int)= buildString {
3+
var cN=_cN
4+
while (cN>0) {
5+
val rem= (cN-1)%26
6+
val char='A'+ rem
7+
insert(0, char)
8+
cN= (cN-1)/26
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp