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 11package 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+
37public class _14 {
48
59 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) {
2222 || envelopes [0 ].length == 0 || envelopes [0 ].length != 2 ) {
2323 return 0 ;
2424 }
25- Arrays .sort (envelopes , (int [] a , int [] b ) ->
26- {
25+ Arrays .sort (envelopes , (int [] a , int [] b ) -> {
2726 if (a [0 ] == b [0 ]) {
2827 return b [1 ] - a [1 ];
2928 } else {
Original file line number Diff line number Diff line change 11package com .fishercoder .solutions ;
2+
23/**
34 * 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+
912public class _67 {
1013 //then I turned to Discuss, this post is concise: https://discuss.leetcode.com/topic/13698/short-ac-solution-in-java-with-explanation
1114 //Tricks and things learned that could be learned:
You can’t perform that action at this time.
0 commit comments