@@ -41,6 +41,51 @@ This repo contains **Python solutions** for the top 250 most frequently asked **
41
41
> Solved: ✅ XX
42
42
> Remaining: 🔄 XX
43
43
44
+ ## 📘 Folder Structure
45
+
46
+ Leetcode-250/
47
+ │
48
+ ├── Arrays/
49
+ │ ├── 1_Two_Sum.py
50
+ │ └── 121_Best_Time_to_Buy_and_Sell_Stock.py
51
+ │
52
+ ├── DP/
53
+ │ └── 70_Climbing_Stairs.py
54
+ │
55
+ ├── Trees/
56
+ │ └── 94_Binary_Tree_Inorder_Traversal.py
57
+ │
58
+ ├── README.md
59
+
60
+ python
61
+ Copy
62
+ Edit
63
+
64
+ ---
65
+
66
+ ## 🧠 Example Format for Each Solution
67
+
68
+ ``` python
69
+ """
70
+ Problem: 121. Best Time to Buy and Sell Stock
71
+ Link: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
72
+ Level: Easy
73
+
74
+ Approach:
75
+ - Track the minimum price seen so far
76
+ - Track the maximum profit if sold today
77
+
78
+ Time Complexity: O(n)
79
+ Space Complexity: O(1)
80
+ """
81
+
82
+ def maxProfit (prices ):
83
+ min_price = float (' inf' )
84
+ max_profit = 0
85
+ for p in prices:
86
+ min_price = min (min_price, p)
87
+ max_profit = max (max_profit, p - min_price)
88
+ return max_profit
44
89
Update: Daily commits on problem- solving
45
90
46
91
-- -
0 commit comments