Skip to content

Commit 8d100df

Browse files
refactor 160
1 parent d772b0e commit 8d100df

File tree

1 file changed

+4
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+4
-2
lines changed

src/main/java/com/fishercoder/solutions/_160.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
public class _160 {
99

1010
public static class Solution1 {
11-
11+
/**
12+
* Time: O(max(m, n))
13+
* Space: O(1)
14+
*/
1215
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
1316
int lenA = findLen(headA);
1417
int lenB = findLen(headB);
@@ -45,7 +48,6 @@ private int findLen(ListNode head) {
4548
public static class Solution2 {
4649
/**
4750
* Most optimal solution:
48-
* <p>
4951
* O(m+n) time
5052
* O(1) space
5153
* credit: https://discuss.leetcode.com/topic/28067/java-solution-without-knowing-the-difference-in-len

0 commit comments

Comments
 (0)