Spaces:
Runtime error
Runtime error
Create scripts/leetcode_fetch.py
Browse files- scripts/leetcode_fetch.py +13 -0
scripts/leetcode_fetch.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
def run_lc_sync(mode):
|
| 5 |
+
# logic for 'daily', 'sync', etc.
|
| 6 |
+
# For demonstration, we simulate the 'daily' output
|
| 7 |
+
daily_data = {"id": 1, "title": "Example Problem", "difficulty": "Medium"}
|
| 8 |
+
|
| 9 |
+
output_path = f"lc_{mode}.json"
|
| 10 |
+
with open(output_path, "w") as f:
|
| 11 |
+
json.dump(daily_data, f)
|
| 12 |
+
|
| 13 |
+
return output_path
|