We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent feb1d16 commit b7fef3fCopy full SHA for b7fef3f
_includes/_root/excel-sheet-column-number/README.md
_includes/_root/excel-sheet-column-number/Solution.java
@@ -0,0 +1,18 @@
1
+public class Solution {
2
+ public int titleToNumber(String s) {
3
+ char[] S = s.toCharArray();
4
+
5
+ int n = 0;
6
7
+ int p = 1;
8
9
+ for(int i = S.length - 1; i >= 0; i--){
10
11
+ n += (S[i] - 'A' + 1) * p;
12
13
+ p *= 26;
14
+ }
15
16
+ return n;
17
18
+}
excel-sheet-column-number/index.md
@@ -1,7 +1,7 @@
---
layout: solution
title: Excel Sheet Column Number
-date: 2014-12-28 23:03:17+08:00
+date: 2014-12-28 23:11:22 +0800
{% assign leetcode_name = {{page.path | remove: '/index.md'}} %}
{% assign leetcode_readme = {{leetcode_name | append: '/README.md' | prepend: '_root/' }} %}
0 commit comments