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
@@ -8,11 +8,11 @@
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 269 :lc-lang python3
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 269
#+end_src
@@ -49,13 +49,13 @@ Explanation: Another possible reconstruction is ["JFK","SFO","ATL","JFK","ATL","
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 332 :lc-lang python3
class Solution:
def findItinerary(self, tickets: List[List[str]]) -> List[str]:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 332
class Solution {
public:
vector<string> findItinerary(vector<vector<string>>& tickets) {
@@ -55,13 +55,13 @@ Output: -1
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 743 :lc-lang python3
class Solution:
def networkDelayTime(self, times: List[List[int]], n: int, k: int) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 743
class Solution {
public:
int networkDelayTime(vector<vector<int>>& times, int n, int k) {
@@ -53,13 +53,13 @@ We need to wait until time 16 so that (0, 0) and (4, 4) are connected.
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 778 :lc-lang python3
class Solution:
def swimInWater(self, grid: List[List[int]]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 778
class Solution {
public:
int swimInWater(vector<vector<int>>& grid) {
@@ -69,13 +69,13 @@ The optimal path with no stops from city 0 to 2 is marked in red and has cost 50
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 787 :lc-lang python3
class Solution:
def findCheapestPrice(self, n: int, flights: List[List[int]], src: int, dst: int, k: int) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 787
class Solution {
public:
int findCheapestPrice(int n, vector<vector<int>>& flights, int src, int dst, int k) {
@@ -44,13 +44,13 @@ Output: 18
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 1584 :lc-lang python3
class Solution:
def minCostConnectPoints(self, points: List[List[int]]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 1584
class Solution {
public:
int minCostConnectPoints(vector<vector<int>>& points) {
@@ -61,13 +61,13 @@ It can be shown that no grouping is possible.
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 2493 :lc-lang python3
class Solution:
def magnificentSets(self, n: int, edges: List[List[int]]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 2493
class Solution {
public:
int magnificentSets(int n, vector<vector<int>>& edges) {
@@ -69,13 +69,13 @@ It can be shown that there are no other paths with a higher safeness factor.
Write your approach here.
** TODO Python
#+begin_src python
#+begin_src python :lc-problem 2812 :lc-lang python3
class Solution:
def maximumSafenessFactor(self, grid: List[List[int]]) -> int:
#+end_src
** TODO C++
#+begin_src cpp
#+begin_src cpp :lc-problem 2812
class Solution {
public:
int maximumSafenessFactor(vector<vector<int>>& grid) {