tags: Weekly Contest

Weekly Contest 420

3324. Find the Sequence of Strings Appeared on the Screen (Medium)

Solution

暴力解,就這樣。

時間複雜度:
O(n2)

空間複雜度:
O(n2)

程式碼:

class Solution { public: vector<string> stringSequence(string target) { vector<string> results; string temp; for (int i = 0; i < target.size(); i++) { for (int j = int('a'); j <= target[i]; j++) { temp.push_back(char(j)); results.push_back(temp); temp.pop_back(); } temp.push_back(target[i]); } return results; } };

3325. Count Substrings With K-Frequency Characters I (Medium)

Solution

時間複雜度:

空間複雜度:

程式碼:

3326. Minimum Division Operations to Make Array Non Decreasing (Medium)

Solution

時間複雜度:

空間複雜度:

程式碼:

3327. Check if DFS Strings Are Palindromes (Hard)

Solution

時間複雜度:

空間複雜度:

程式碼: