File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
- /**Write a function to find the longest common prefix string amongst an array of strings.*/
2
+
3
+ /**
4
+ * Write a function to find the longest common prefix string amongst an array of strings.
5
+ */
6
+
3
7
public class _14 {
4
8
5
9
public static String longestCommonPrefix (String [] strs ) {
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ public int maxEnvelopes(int[][] envelopes) {
22
22
|| envelopes [0 ].length == 0 || envelopes [0 ].length != 2 ) {
23
23
return 0 ;
24
24
}
25
- Arrays .sort (envelopes , (int [] a , int [] b ) ->
26
- {
25
+ Arrays .sort (envelopes , (int [] a , int [] b ) -> {
27
26
if (a [0 ] == b [0 ]) {
28
27
return b [1 ] - a [1 ];
29
28
} else {
Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
+
2
3
/**
3
4
* 67. Add Binary
4
- Given two binary strings, return their sum (also a binary string).
5
- For example,
6
- a = "11"
7
- b = "1"
8
- Return "100".*/
5
+ * Given two binary strings, return their sum (also a binary string).
6
+ * For example,
7
+ * a = "11"
8
+ * b = "1"
9
+ * Return "100".
10
+ */
11
+
9
12
public class _67 {
10
13
//then I turned to Discuss, this post is concise: https://discuss.leetcode.com/topic/13698/short-ac-solution-in-java-with-explanation
11
14
//Tricks and things learned that could be learned:
You can’t perform that action at this time.
0 commit comments