Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d100df

Browse files
refactor 160
1 parentd772b0e commit8d100df

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
publicclass_160 {
99

1010
publicstaticclassSolution1 {
11-
11+
/**
12+
* Time: O(max(m, n))
13+
* Space: O(1)
14+
*/
1215
publicListNodegetIntersectionNode(ListNodeheadA,ListNodeheadB) {
1316
intlenA =findLen(headA);
1417
intlenB =findLen(headB);
@@ -45,7 +48,6 @@ private int findLen(ListNode head) {
4548
publicstaticclassSolution2 {
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)

[8]ページ先頭

©2009-2025 Movatter.jp