-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlc-init
executable file
·93 lines (70 loc) · 1.57 KB
/
lc-init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
if [ $# -gt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "$0 initializes the directory structure for LeetCode problem solving"
echo "$0 also creates a README file to track the progress of solved problems"
exit 1
fi
TOPICS=(
"Arrays & Hashing"
"Backtracking"
"Binary Search"
"Binary Trees"
"Bit Manipulation"
"Dynamic Programming 1D"
"Dynamic Programming 2D"
"Graphs"
"Graphs Advanced"
"Greedy"
"Intervals"
"Linked Lists"
"Math & Geometry"
"Priority Queue"
"Sliding Window"
"Stack"
"Tries"
"Two Pointers"
)
DIFFICULTIES=(
"Easy"
"Medium"
"Hard"
)
for TOPIC in "${TOPICS[@]}"; do
for DIFFICULTY in "${DIFFICULTIES[@]}"; do
mkdir -p "$(pwd)"/"$TOPIC"/"$DIFFICULTY"
done
done
cat > README.md << EOF
# LeetCode Solutions/Analysis
> Collection of my solutions to [LeetCode](https://leetcode.com) problems
## Table of Contents
- [Progress Tracking](#progress-tracking)
- [Milestones](#milestones)
- [Useful Links](#useful-links)
## Progress Tracking
### Problems Solved
| Total | 0 |
|:---:|:---:|
#### Search By Topic
| Topic | Number |
|:---|---:|
EOF
for TOPIC in "${TOPICS[@]}"; do
echo "| $TOPIC | 0 |" >> README.md
done
cat >> README.md << EOF
#### Search By Difficulty
| Difficulty | Number |
|:---|---:|
EOF
for DIFFICULTY in "${DIFFICULTIES[@]}"; do
echo "| $DIFFICULTY | 0 |" >> README.md
done
cat >> README.md << EOF
## Milestones
| Date | Description |
|------|-------------|
| | |
## Useful Links
EOF
exit 0