Skip to content

Commit dc18b44

Browse files
authored
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)