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
@@ -54,13 +54,13 @@ An input string is valid if:
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 20 :lc-lang python3
class Solution:
def isValid(self, s: str) -> bool:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 20
class Solution {
public:
bool isValid(string s) {
@@ -36,13 +36,13 @@ Output: 4
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 84 :lc-lang python3
class Solution:
def largestRectangleArea(self, heights: List[int]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 84
class Solution {
public:
int largestRectangleArea(vector<int>& heights) {
@@ -68,13 +68,13 @@ Explanation: ((10 * (6 / ((9 + 3) * -11))) + 17) + 5
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 150 :lc-lang python3
class Solution:
def evalRPN(self, tokens: List[str]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 150
class Solution {
public:
int evalRPN(vector<string>& tokens) {
@@ -55,7 +55,7 @@ minStack.getMin(); // return -2
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 155 :lc-lang python3
class MinStack:
def __init__(self):
@@ -83,7 +83,7 @@ class MinStack:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 155
class MinStack {
public:
MinStack() {
@@ -90,13 +90,13 @@ Since the record is empty, the total sum is 0.
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 682 :lc-lang python3
class Solution:
def calPoints(self, operations: List[str]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 682
class Solution {
public:
int calPoints(vector<string>& operations) {
@@ -66,13 +66,13 @@ Explanation: The count of elements are {&#39;K&#39;: 4, &#39;N&#39;: 2, &#39;O&#
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 726 :lc-lang python3
class Solution:
def countOfAtoms(self, formula: str) -> str:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 726
class Solution {
public:
string countOfAtoms(string formula) {
@@ -39,13 +39,13 @@ Output: [1,1,0]
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 739 :lc-lang python3
class Solution:
def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 739
class Solution {
public:
vector<int> dailyTemperatures(vector<int>& temperatures) {
@@ -70,13 +70,13 @@ There is only one car, hence there is only one fleet.
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 853 :lc-lang python3
class Solution:
def carFleet(self, target: int, position: List[int], speed: List[int]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 853
class Solution {
public:
int carFleet(int target, vector<int>& position, vector<int>& speed) {
@@ -50,7 +50,7 @@ stockSpanner.next(85); // return 6
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 901 :lc-lang python3
class StockSpanner:
def __init__(self):
@@ -66,7 +66,7 @@ class StockSpanner:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 901
class StockSpanner {
public:
StockSpanner() {
@@ -59,13 +59,13 @@ Output: "s"
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 1544 :lc-lang python3
class Solution:
def makeGood(self, s: str) -> str:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 1544
class Solution {
public:
string makeGood(string s) {