This commit is contained in:
2026-06-05 22:32:49 +08:00
parent 14d05011d5
commit c67841fe07
202 changed files with 498 additions and 403 deletions
@@ -47,13 +47,13 @@ Notice that the answer must be a substring, "pwke" is a subsequence and not a su
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 3 :lc-lang python3
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 3
class Solution {
public:
int lengthOfLongestSubstring(string s) {
@@ -55,13 +55,13 @@ Since the largest window of s only has one 'a', return empty string.
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 76 :lc-lang python3
class Solution:
def minWindow(self, s: str, t: str) -> str:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 76
class Solution {
public:
string minWindow(string s, string t) {
@@ -41,13 +41,13 @@ Explanation: In this case, no transactions are done and the max profit = 0.
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 121 :lc-lang python3
class Solution:
def maxProfit(self, prices: List[int]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 121
class Solution {
public:
int maxProfit(vector<int>& prices) {
@@ -47,13 +47,13 @@ Output: [1]
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 239 :lc-lang python3
class Solution:
def maxSlidingWindow(self, nums: List[int], k: int) -> List[int]:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 239
class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
@@ -42,13 +42,13 @@ There may exists other ways to achieve this answer too.
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 424 :lc-lang python3
class Solution:
def characterReplacement(self, s: str, k: int) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 424
class Solution {
public:
int characterReplacement(string s, int k) {
@@ -37,13 +37,13 @@ Output: false
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 567 :lc-lang python3
class Solution:
def checkInclusion(self, s1: str, s2: str) -> bool:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 567
class Solution {
public:
bool checkInclusion(string s1, string s2) {
@@ -56,13 +56,13 @@ The substrings with every vowel and one consonant are:
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 3306 :lc-lang python3
class Solution:
def countOfSubstrings(self, word: str, k: int) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 3306
class Solution {
public:
long long countOfSubstrings(string word, int k) {