We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 175acfc + e148a4d commit 0d6facfCopy full SHA for 0d6facf
2018.12.3-leetcode58/家
@@ -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
+func isSymmetric(root *TreeNode) bool {
+ return isw(root,root)
+func isw (left *TreeNode,right *TreeNode) bool{
+ if left == nil && right == nil {return true}
+ if left == nil || right == nil{return false}
+ return left.Val == right.Val && isw(left.Left,right.Right)&&isw(left.Right,right.Left)
0 commit comments