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

Commit dc18b44

Browse files
Update Construct the Lexicographically Largest Valid Sequence
1 parent 50a2a48 commit dc18b44

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎Daily Question/2025/February/Construct the Lexicographically Largest Valid Sequence

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Time Complexity : O(n!) for there are n! possible sequence
66
n * (n - 1) * (n - 2) ... * 1 = O(n!) )
77
Space Complexity : O(n! for the recursion (recursion depth = O(n))
88

9+
實務上運算找到解的速度會比複雜度快上許多,因為設定上只要一找到解就可以回傳(同時題目保證一定有解)
10+
911
class Solution {
1012
public:
1113
vector<int> ans , appear ;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /