File tree 8 files changed +28
-5
lines changed
8 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,5 @@ All solutions will be accepted!
10
10
| 476| [ Number Complement] ( https://leetcode-cn.com/problems/number-complement/description/ ) | [ java/py/js] ( ./algorithms/NumberComplement ) | Easy|
11
11
| 728| [ Self Dividing Numbers] ( https://leetcode-cn.com/problems/self-dividing-numbers/description/ ) | [ java/py/js] ( ./algorithms/SelfDividingNumbers ) | Easy|
12
12
| 804| [ Unique Morse Code Words] ( https://leetcode-cn.com/problems/unique-morse-code-words/description/ ) | [ java/py/js] ( ./algorithms/UniqueMorseCodeWords ) | Easy|
13
- | 500| [ Keyboard Row] ( https://leetcode-cn.com/problems/keyboard-row/description/ ) | [ java/py/js] ( ./algorithms/KeyboardRow ) | Easy|
13
+ | 500| [ Keyboard Row] ( https://leetcode-cn.com/problems/keyboard-row/description/ ) | [ java/py/js] ( ./algorithms/KeyboardRow ) | Easy|
14
+ | 344| [ Reverse String] ( https://leetcode-cn.com/problems/reverse-string/ ) | [ java/py/js] ( ./algorithms/ReverseString ) | Easy|
Original file line number Diff line number Diff line change 1
1
# Hamming Distance
2
- use bitwise to solve this problem
2
+ Use bitwise to solve this problem
Original file line number Diff line number Diff line change 1
1
# Keyboard Row
2
- we can use prime product to get modulo to solve this problem, but be careful about js's Number overflow!
2
+ We can use prime product to get modulo to solve this problem, but be careful about js's Number overflow!
Original file line number Diff line number Diff line change 1
1
# Number Complement
2
- use bitwise to solve this problem
3
- becareful the overflow
2
+ Use bitwise to solve this problem, becareful the overflow
Original file line number Diff line number Diff line change
1
+ # Reverse String
2
+ This problem is easy to solve
Original file line number Diff line number Diff line change
1
+ class Solution {
2
+ public String reverseString (String s ) {
3
+ return new StringBuffer (s ).reverse ().toString ();
4
+ }
5
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @param {string } s
3
+ * @return {string }
4
+ */
5
+ var reverseString = function ( s ) {
6
+ return s . split ( '' ) . reverse ( ) . join ( '' )
7
+ } ;
Original file line number Diff line number Diff line change
1
+ class Solution (object ):
2
+ def reverseString (self , s ):
3
+ """
4
+ :type s: str
5
+ :rtype: str
6
+ """
7
+ s = list (s )
8
+ s .reverse ()
9
+ return '' .join (s )
You can’t perform that action at this time.
0 commit comments