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

Commitf46ab6c

Browse files
committed
Added documentation for JS problem 115
1 parentce20f9e commitf46ab6c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎javascript/115-Distinct-Subsequences.js‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//////////////////////////////////////////////////////////////////////////////
2+
// 1D Dynamic Programming
3+
// Time: O(n*m)
4+
// Space: O(m)
5+
//////////////////////////////////////////////////////////////////////////////
6+
17
/**
28
*@param {string} s
39
*@param {string} t
@@ -28,6 +34,12 @@ function numDistinct(s, t) {
2834
returncache[0];
2935
}
3036

37+
//////////////////////////////////////////////////////////////////////////////
38+
// 2D Dynamic Programming
39+
// Time: O(n*m)
40+
// Space: O(n*m)
41+
//////////////////////////////////////////////////////////////////////////////
42+
3143
/**
3244
*@param {string} s
3345
*@param {string} t
@@ -63,6 +75,12 @@ function numDistinct(s, t) {
6375
returncache[0][0];
6476
}
6577

78+
//////////////////////////////////////////////////////////////////////////////
79+
// Depth First Search Recursion With Memoization
80+
// Time: O(n*m)
81+
// Space: O(n*m)
82+
//////////////////////////////////////////////////////////////////////////////
83+
6684
/**
6785
*@param {string} s
6886
*@param {string} t

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp