|
1 | 1 | # `Today Update`
|
2 | 2 | ## Math
|
3 |
| -### 258 Add Digits |
4 |
| -* [Github:#258 Add Digits](/Math/Math.Lib/AddDigitsSln.cs) |
5 |
| -* [CSDN:#258 Add Digits](http://blog.csdn.net/daigualu/article/details/72724479) |
6 |
| - * Tips: |
7 |
| - * https://en.wikipedia.org/wiki/Digital_root#Congruence_formula |
8 |
| - * https://en.wikipedia.org/wiki/Vedic_square |
9 |
| - * In Indian mathematics, a Vedic square is a variation on a typical 9 × 9 multiplication table where the entry in each cell is the digital root of the product of the column and row headings i.e. the remainder when the product of the row and column headings is divided by 9 (with remainder 0 represented by 9). Numerous geometric patterns and symmetries can be observed in a Vedic square some of which can be found in traditional Islamic art. |
10 |
| -  |
11 |
| - |
12 |
| ---- |
| 3 | +### 263 Ugly Number |
| 4 | +* [Github:#263 Ugly Number](/Math/Math.Lib/UglyNumberSln.cs) |
| 5 | +* [CSDN:#263 Ugly Number](http://blog.csdn.net/daigualu/article/details/72765438) |
| 6 | + * ```C# |
| 7 | + public bool IsUgly(int num) |
| 8 | + { |
| 9 | + if (num <= 0) return false; |
| 10 | + if (num == 1) return true; |
| 11 | + while (num >1) |
| 12 | + { |
| 13 | + if(num%2==0) |
| 14 | + num /= 2; |
| 15 | + else if (num%3 == 0) |
| 16 | + num /= 3; |
| 17 | + else if (num%5 == 0) |
| 18 | + num /= 5; |
| 19 | + else return false; |
| 20 | + } |
| 21 | + return true; |
| 22 | + } |
| 23 | + ``` |
| 24 | +-- |
13 | 25 | ---
|
14 | 26 |
|
15 | 27 |
|
@@ -198,6 +210,16 @@ Tags are following:
|
198 | 210 | ### 171 Excel Sheet Column Number
|
199 | 211 | * [Github:#171 Excel Sheet Column Number](/Math/Math.Lib/ExcelColumnNumberSln.cs)
|
200 | 212 | * [CSDN:#171 Excel Sheet Column Number](http://blog.csdn.net/daigualu/article/details/72717145)
|
| 213 | +### 258 Add Digits |
| 214 | +* [Github:#258 Add Digits](/Math/Math.Lib/AddDigitsSln.cs) |
| 215 | +* [CSDN:#258 Add Digits](http://blog.csdn.net/daigualu/article/details/72724479) |
| 216 | + * Tips: |
| 217 | + * https://en.wikipedia.org/wiki/Digital_root#Congruence_formula |
| 218 | + * https://en.wikipedia.org/wiki/Vedic_square |
| 219 | + * In Indian mathematics, a Vedic square is a variation on a typical 9 × 9 multiplication table where the entry in each cell is the digital root of the product of the column and row headings i.e. the remainder when the product of the row and column headings is divided by 9 (with remainder 0 represented by 9). Numerous geometric patterns and symmetries can be observed in a Vedic square some of which can be found in traditional Islamic art. |
| 220 | +  |
| 221 | + |
| 222 | + |
201 | 223 | ## Two Pointers
|
202 | 224 | * [#345 Reverse Vowels of a String](http://blog.csdn.net/daigualu/article/details/69257693)
|
203 | 225 |
|
|
0 commit comments