Skip to content

Commit 6e8f40a

Browse files
committed
readme
1 parent 86db88f commit 6e8f40a

File tree

1 file changed

+49
-13
lines changed

1 file changed

+49
-13
lines changed

README.md

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1+
# `Today Update`
2+
## Math
3+
### 9 Palindrome Number
4+
* [Github:#9 Palindrome Number](/Math/Math.Lib/IssPalindromeSln.cs)
5+
* [CSDN:#9 Palindrome Number](http://blog.csdn.net/daigualu/article/details/72717009)
6+
```C#
7+
public bool IsPalindrome(int x)
8+
{
9+
int palindromex = 0, tmp = x;
10+
int sumbit = 0;
11+
//calcuate bit count
12+
while (tmp > 0)
13+
{
14+
sumbit++;
15+
tmp /= 10;
16+
}
17+
tmp = x;
18+
//get a number reversely
19+
while (tmp > 0)
20+
{
21+
//if palindromex happens overflow, it would return false;
22+
palindromex += tmp % 10 * (int)System.Math.Pow(10, --sumbit);
23+
tmp /= 10;
24+
}
25+
return palindromex == x;
26+
}
27+
```
28+
29+
### 171 Excel Sheet Column Number
30+
* [Github:#171 Excel Sheet Column Number](/Math/Math.Lib/ExcelColumnNumberSln.cs)
31+
* [CSDN:#171 Excel Sheet Column Number](http://blog.csdn.net/daigualu/article/details/72717145)
32+
```C#
33+
public int TitleToNumber(string s)
34+
{
35+
char[] chs= {'A','B','C','D','E','F','G','H','I','J','K',
36+
'L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
37+
Dictionary<char,int> dict = new Dictionary<char,int>();
38+
for(int i=0; i<chs.Length;i++) dict.Add(chs[i],i+1);
39+
int scnt = s.Length, rtnsum=0;
40+
for (int i = scnt - 1,j=0; i >= 0; i--,j++)
41+
rtnsum += dict[s[i]] * (int)System.Math.Pow(26, j);
42+
return rtnsum;
43+
}
44+
45+
```
46+
---
47+
---
48+
49+
150
# About it
251
Algorithm is tool for exercising our thinking patterns, and we can strengthen the ability to convert mathematical models into code. Whether you are engaged in artificial intelligence, in-depth learning, or advanced software development, no matter what language you use, such as C#,C++,Java,python,etc., and applying the most appropriate algorithm is always the most important point when faced with a specific problem. *Every problem in practice has its own particularity, which makes it not that easier to choose the most appropriate algorithm.* How do we write the algorithm that most efficiently apply to a practical issue? **Yes, LeetCode.** You can write an algorithm until it accepted, and do not rush to do the next question, and learn the solution someone else has submitted, `so you can solve the problem from the ability of solving the problem to that fast and efficient realm`.
352

@@ -12,19 +61,6 @@ Anyway, welcome to view, star and fork, then contribute.
1261
4. Push to the branch: git push origin my-leetcode-csharp
1362
5. Submit a pull request and enjoy! :D
1463

15-
## `Today Update`
16-
### Math
17-
#### 9 Palindrome Number
18-
* [Github:#9 Palindrome Number](/Math/Math.Lib/IssPalindromeSln.cs)
19-
* [CSDN:#9 Palindrome Number](http://blog.csdn.net/daigualu/article/details/72717009)
20-
21-
#### 171 Excel Sheet Column Number
22-
* [Github:#171 Excel Sheet Column Number](/Math/Math.Lib/ExcelColumnNumberSln.cs)
23-
* [CSDN:#171 Excel Sheet Column Number](http://blog.csdn.net/daigualu/article/details/72717145)
24-
25-
---
26-
---
27-
2864
## Solution List
2965
solutions using C# for leetcode according to tags of questions
3066
Tags are following:

0 commit comments

Comments
 (0)