@@ -17,7 +17,7 @@ create_solution() {
17
17
read -p " Enter the title of the problem: " title
18
18
19
19
# Generate URL using submission ID
20
- url=" /submissions/detail/$submission_id /"
20
+ url=" https://leetcode.com /submissions/detail/$submission_id /"
21
21
22
22
# Create the metadata.json without the code field
23
23
metadata_json=" $solution_folder /metadata.json"
@@ -30,11 +30,11 @@ create_solution() {
30
30
"timestamp": $( date +%s) ,
31
31
"status": 10,
32
32
"status_display": "Accepted",
33
- "runtime": "$runtime ",
33
+ "runtime": "$runtime ms ",
34
34
"url": "$url ",
35
35
"is_pending": "Not Pending",
36
36
"title": "$title ",
37
- "memory": "$memory ",
37
+ "memory": "$memory MB ",
38
38
"title_slug": "$( echo $title | tr ' [:upper:]' ' [:lower:]' | tr ' ' ' -' ) ",
39
39
"has_notes": false,
40
40
"flag_type": 1
49
49
**Question ID**: $question_id
50
50
**Language**: C++
51
51
**Status**: Accepted
52
- **Runtime**: $runtime
53
- **Memory**: $memory
52
+ **Runtime**: $runtime ms
53
+ **Memory**: $memory MB
54
54
55
55
## Solution Code
56
56
\`\`\` cpp
57
- // Solution code removed intentionally.
57
+ $url
58
58
\`\`\`
59
+ EOF
60
+ solution=" $solution_folder /solution.cpp"
61
+ cat << EOF > "$solution "
62
+ #include <bits/stdc++.h>
63
+ using namespace std;
64
+
65
+ $url
66
+
59
67
EOF
60
68
61
69
echo " Solution folder created: $solution_folder "
62
- echo " README.md and metadata.json files created successfully."
70
+ echo " README.md , metadata.json solution.cpp files created successfully."
63
71
}
64
72
65
73
# Run the function to create a solution
0 commit comments