Skip to content

Commit 0d6facf

Browse files
authored
Merge pull request gzc426#294 from HanqingZheng/master
今天和明天的
2 parents 175acfc + e148a4d commit 0d6facf

File tree

2 files changed

+22
-0
lines changed
  • 2018.12.3-leetcode58
  • 2018.12.4-leetcode101

2 files changed

+22
-0
lines changed

2018.12.3-leetcode58/家

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```
2+
func lengthOfLastWord(s string) int {
3+
l := len(s)
4+
i := l-1
5+
count := 0
6+
for ;i>=0 && s[i] == ' ';i--{}
7+
for ;i>=0 && s[i] != ' ';i--{count++}
8+
return count
9+
}
10+
11+
```

2018.12.4-leetcode101/家.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```
2+
func isSymmetric(root *TreeNode) bool {
3+
return isw(root,root)
4+
}
5+
func isw (left *TreeNode,right *TreeNode) bool{
6+
if left == nil && right == nil {return true}
7+
if left == nil || right == nil{return false}
8+
return left.Val == right.Val && isw(left.Left,right.Right)&&isw(left.Right,right.Left)
9+
}
10+
11+
```

0 commit comments

Comments
 (0)