Chore: Add headers to all the files (#54)

## Description
- Add headers to all the CSV files

## Script used
```py
import csv
import os

# Set the path of the folder containing the CSV files
folder_path = "./LeetCode-Questions-CompanyWise"
headers = [
    "ID",
    "Title",
    "Acceptance",
    "Difficulty",
    "Frequency",
    "Leetcode Question Link",
]

# Loop through all the CSV files in the folder
for file_name in os.listdir(folder_path):
    if file_name.endswith(".csv"):
        # Read the CSV file into a list of rows
        file_path = os.path.join(folder_path, file_name)
        with open(file_path, "r") as f:
            reader = csv.reader(f)
            rows = list(reader)

        has_headers = False
        if len(rows) > 0 and rows[0] == headers:
            has_headers = True

        if not has_headers:
            rows.insert(0, headers)

            # Write the list of rows back to the CSV file
            with open(file_path, "w", newline="") as f:
                writer = csv.writer(f)
                writer.writerows(rows)

```
This commit is contained in:
Krishna Kumar Dey
2023-04-01 11:07:49 +05:30
committed by GitHub
parent 0aeadbd612
commit fb5f78b55e
534 changed files with 20291 additions and 19757 deletions

View File

@@ -1,40 +1,41 @@
759,Employee Free Time,66.3%,Hard,1.6706917846283542, https://leetcode.com/problems/employee-free-time
811,Subdomain Visit Count,69.9%,Easy,1.2027673650415363, https://leetcode.com/problems/subdomain-visit-count
277,Find the Celebrity,41.8%,Medium,0.7348429454547184, https://leetcode.com/problems/find-the-celebrity
770,Basic Calculator IV,48.1%,Hard,0.538996500732687, https://leetcode.com/problems/basic-calculator-iv
632,Smallest Range Covering Elements from K Lists,52.4%,Hard,0.37755631999108785, https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists
362,Design Hit Counter,63.7%,Medium,0.34451909789108437, https://leetcode.com/problems/design-hit-counter
564,Find the Closest Palindrome,19.7%,Hard,0.3007541540191337, https://leetcode.com/problems/find-the-closest-palindrome
224,Basic Calculator,36.8%,Hard,0.23074173054528113, https://leetcode.com/problems/basic-calculator
269,Alien Dictionary,33.3%,Hard,0.2306743801916798, https://leetcode.com/problems/alien-dictionary
718,Maximum Length of Repeated Subarray,49.4%,Medium,0.16528289916664798, https://leetcode.com/problems/maximum-length-of-repeated-subarray
772,Basic Calculator III,41.3%,Hard,0.13720112151348504, https://leetcode.com/problems/basic-calculator-iii
68,Text Justification,27.7%,Hard,0.10627110304957266, https://leetcode.com/problems/text-justification
254,Factor Combinations,46.7%,Medium,0.10058723690516862, https://leetcode.com/problems/factor-combinations
126,Word Ladder II,22.1%,Hard,0.07011193038456472, https://leetcode.com/problems/word-ladder-ii
726,Number of Atoms,49.0%,Hard,0.06371581438610768, https://leetcode.com/problems/number-of-atoms
428,Serialize and Deserialize N-ary Tree,59.4%,Hard,0.06136894637629212, https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree
158,Read N Characters Given Read4 II - Call multiple times,33.8%,Hard,0.05800594958851697, https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times
935,Knight Dialer,45.2%,Medium,0.04445176257083384, https://leetcode.com/problems/knight-dialer
261,Graph Valid Tree,42.2%,Medium,0.03683657735649026, https://leetcode.com/problems/graph-valid-tree
698,Partition to K Equal Sum Subsets,45.0%,Medium,0.02109782896463587, https://leetcode.com/problems/partition-to-k-equal-sum-subsets
392,Is Subsequence,49.2%,Easy,0.02033508842008217, https://leetcode.com/problems/is-subsequence
341,Flatten Nested List Iterator,52.9%,Medium,0.019980684690483426, https://leetcode.com/problems/flatten-nested-list-iterator
202,Happy Number,50.4%,Easy,0.014045174703047602, https://leetcode.com/problems/happy-number
986,Interval List Intersections,67.3%,Medium,0.011969023795320735, https://leetcode.com/problems/interval-list-intersections
146,LRU Cache,33.2%,Medium,0.010321192540274932, https://leetcode.com/problems/lru-cache
380,Insert Delete GetRandom O(1),47.5%,Medium,0.009820849864094454, https://leetcode.com/problems/insert-delete-getrandom-o1
208,Implement Trie (Prefix Tree),49.4%,Medium,0.009105457856626612, https://leetcode.com/problems/implement-trie-prefix-tree
295,Find Median from Data Stream,44.3%,Hard,0.00899893586856953, https://leetcode.com/problems/find-median-from-data-stream
239,Sliding Window Maximum,43.0%,Hard,0.007898935224534491, https://leetcode.com/problems/sliding-window-maximum
14,Longest Common Prefix,35.4%,Easy,0.00745530292090591, https://leetcode.com/problems/longest-common-prefix
36,Valid Sudoku,48.7%,Medium,0.007258242715805398, https://leetcode.com/problems/valid-sudoku
127,Word Ladder,29.6%,Medium,0.005979091056058075, https://leetcode.com/problems/word-ladder
91,Decode Ways,24.7%,Medium,0.005968385368349129, https://leetcode.com/problems/decode-ways
236,Lowest Common Ancestor of a Binary Tree,45.7%,Medium,0.004714210262726446, https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
139,Word Break,40.1%,Medium,0.003894465052690167, https://leetcode.com/problems/word-break
79,Word Search,35.6%,Medium,0.003741741363018696, https://leetcode.com/problems/word-search
56,Merge Intervals,39.3%,Medium,0.0034728286335985107, https://leetcode.com/problems/merge-intervals
140,Word Break II,32.6%,Hard,0.0027070942357783584, https://leetcode.com/problems/word-break-ii
621,Task Scheduler,50.1%,Medium,0.002341784338144407, https://leetcode.com/problems/task-scheduler
210,Course Schedule II,40.7%,Medium,0.0019086707135282834, https://leetcode.com/problems/course-schedule-ii
ID,Title,Acceptance,Difficulty,Frequency,Leetcode Question Link
759,Employee Free Time,66.3%,Hard,1.6706917846283542, https://leetcode.com/problems/employee-free-time
811,Subdomain Visit Count,69.9%,Easy,1.2027673650415363, https://leetcode.com/problems/subdomain-visit-count
277,Find the Celebrity,41.8%,Medium,0.7348429454547184, https://leetcode.com/problems/find-the-celebrity
770,Basic Calculator IV,48.1%,Hard,0.538996500732687, https://leetcode.com/problems/basic-calculator-iv
632,Smallest Range Covering Elements from K Lists,52.4%,Hard,0.37755631999108785, https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists
362,Design Hit Counter,63.7%,Medium,0.34451909789108437, https://leetcode.com/problems/design-hit-counter
564,Find the Closest Palindrome,19.7%,Hard,0.3007541540191337, https://leetcode.com/problems/find-the-closest-palindrome
224,Basic Calculator,36.8%,Hard,0.23074173054528113, https://leetcode.com/problems/basic-calculator
269,Alien Dictionary,33.3%,Hard,0.2306743801916798, https://leetcode.com/problems/alien-dictionary
718,Maximum Length of Repeated Subarray,49.4%,Medium,0.16528289916664798, https://leetcode.com/problems/maximum-length-of-repeated-subarray
772,Basic Calculator III,41.3%,Hard,0.13720112151348504, https://leetcode.com/problems/basic-calculator-iii
68,Text Justification,27.7%,Hard,0.10627110304957266, https://leetcode.com/problems/text-justification
254,Factor Combinations,46.7%,Medium,0.10058723690516862, https://leetcode.com/problems/factor-combinations
126,Word Ladder II,22.1%,Hard,0.07011193038456472, https://leetcode.com/problems/word-ladder-ii
726,Number of Atoms,49.0%,Hard,0.06371581438610768, https://leetcode.com/problems/number-of-atoms
428,Serialize and Deserialize N-ary Tree,59.4%,Hard,0.06136894637629212, https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree
158,Read N Characters Given Read4 II - Call multiple times,33.8%,Hard,0.05800594958851697, https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times
935,Knight Dialer,45.2%,Medium,0.04445176257083384, https://leetcode.com/problems/knight-dialer
261,Graph Valid Tree,42.2%,Medium,0.03683657735649026, https://leetcode.com/problems/graph-valid-tree
698,Partition to K Equal Sum Subsets,45.0%,Medium,0.02109782896463587, https://leetcode.com/problems/partition-to-k-equal-sum-subsets
392,Is Subsequence,49.2%,Easy,0.02033508842008217, https://leetcode.com/problems/is-subsequence
341,Flatten Nested List Iterator,52.9%,Medium,0.019980684690483426, https://leetcode.com/problems/flatten-nested-list-iterator
202,Happy Number,50.4%,Easy,0.014045174703047602, https://leetcode.com/problems/happy-number
986,Interval List Intersections,67.3%,Medium,0.011969023795320735, https://leetcode.com/problems/interval-list-intersections
146,LRU Cache,33.2%,Medium,0.010321192540274932, https://leetcode.com/problems/lru-cache
380,Insert Delete GetRandom O(1),47.5%,Medium,0.009820849864094454, https://leetcode.com/problems/insert-delete-getrandom-o1
208,Implement Trie (Prefix Tree),49.4%,Medium,0.009105457856626612, https://leetcode.com/problems/implement-trie-prefix-tree
295,Find Median from Data Stream,44.3%,Hard,0.00899893586856953, https://leetcode.com/problems/find-median-from-data-stream
239,Sliding Window Maximum,43.0%,Hard,0.007898935224534491, https://leetcode.com/problems/sliding-window-maximum
14,Longest Common Prefix,35.4%,Easy,0.00745530292090591, https://leetcode.com/problems/longest-common-prefix
36,Valid Sudoku,48.7%,Medium,0.007258242715805398, https://leetcode.com/problems/valid-sudoku
127,Word Ladder,29.6%,Medium,0.005979091056058075, https://leetcode.com/problems/word-ladder
91,Decode Ways,24.7%,Medium,0.005968385368349129, https://leetcode.com/problems/decode-ways
236,Lowest Common Ancestor of a Binary Tree,45.7%,Medium,0.004714210262726446, https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
139,Word Break,40.1%,Medium,0.003894465052690167, https://leetcode.com/problems/word-break
79,Word Search,35.6%,Medium,0.003741741363018696, https://leetcode.com/problems/word-search
56,Merge Intervals,39.3%,Medium,0.0034728286335985107, https://leetcode.com/problems/merge-intervals
140,Word Break II,32.6%,Hard,0.0027070942357783584, https://leetcode.com/problems/word-break-ii
621,Task Scheduler,50.1%,Medium,0.002341784338144407, https://leetcode.com/problems/task-scheduler
210,Course Schedule II,40.7%,Medium,0.0019086707135282834, https://leetcode.com/problems/course-schedule-ii
1 759 ID Employee Free Time Title 66.3% Acceptance Hard Difficulty 1.6706917846283542 Frequency https://leetcode.com/problems/employee-free-time Leetcode Question Link
2 811 759 Subdomain Visit Count Employee Free Time 69.9% 66.3% Easy Hard 1.2027673650415363 1.6706917846283542 https://leetcode.com/problems/subdomain-visit-count https://leetcode.com/problems/employee-free-time
3 277 811 Find the Celebrity Subdomain Visit Count 41.8% 69.9% Medium Easy 0.7348429454547184 1.2027673650415363 https://leetcode.com/problems/find-the-celebrity https://leetcode.com/problems/subdomain-visit-count
4 770 277 Basic Calculator IV Find the Celebrity 48.1% 41.8% Hard Medium 0.538996500732687 0.7348429454547184 https://leetcode.com/problems/basic-calculator-iv https://leetcode.com/problems/find-the-celebrity
5 632 770 Smallest Range Covering Elements from K Lists Basic Calculator IV 52.4% 48.1% Hard Hard 0.37755631999108785 0.538996500732687 https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists https://leetcode.com/problems/basic-calculator-iv
6 362 632 Design Hit Counter Smallest Range Covering Elements from K Lists 63.7% 52.4% Medium Hard 0.34451909789108437 0.37755631999108785 https://leetcode.com/problems/design-hit-counter https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists
7 564 362 Find the Closest Palindrome Design Hit Counter 19.7% 63.7% Hard Medium 0.3007541540191337 0.34451909789108437 https://leetcode.com/problems/find-the-closest-palindrome https://leetcode.com/problems/design-hit-counter
8 224 564 Basic Calculator Find the Closest Palindrome 36.8% 19.7% Hard Hard 0.23074173054528113 0.3007541540191337 https://leetcode.com/problems/basic-calculator https://leetcode.com/problems/find-the-closest-palindrome
9 269 224 Alien Dictionary Basic Calculator 33.3% 36.8% Hard Hard 0.2306743801916798 0.23074173054528113 https://leetcode.com/problems/alien-dictionary https://leetcode.com/problems/basic-calculator
10 718 269 Maximum Length of Repeated Subarray Alien Dictionary 49.4% 33.3% Medium Hard 0.16528289916664798 0.2306743801916798 https://leetcode.com/problems/maximum-length-of-repeated-subarray https://leetcode.com/problems/alien-dictionary
11 772 718 Basic Calculator III Maximum Length of Repeated Subarray 41.3% 49.4% Hard Medium 0.13720112151348504 0.16528289916664798 https://leetcode.com/problems/basic-calculator-iii https://leetcode.com/problems/maximum-length-of-repeated-subarray
12 68 772 Text Justification Basic Calculator III 27.7% 41.3% Hard Hard 0.10627110304957266 0.13720112151348504 https://leetcode.com/problems/text-justification https://leetcode.com/problems/basic-calculator-iii
13 254 68 Factor Combinations Text Justification 46.7% 27.7% Medium Hard 0.10058723690516862 0.10627110304957266 https://leetcode.com/problems/factor-combinations https://leetcode.com/problems/text-justification
14 126 254 Word Ladder II Factor Combinations 22.1% 46.7% Hard Medium 0.07011193038456472 0.10058723690516862 https://leetcode.com/problems/word-ladder-ii https://leetcode.com/problems/factor-combinations
15 726 126 Number of Atoms Word Ladder II 49.0% 22.1% Hard Hard 0.06371581438610768 0.07011193038456472 https://leetcode.com/problems/number-of-atoms https://leetcode.com/problems/word-ladder-ii
16 428 726 Serialize and Deserialize N-ary Tree Number of Atoms 59.4% 49.0% Hard Hard 0.06136894637629212 0.06371581438610768 https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree https://leetcode.com/problems/number-of-atoms
17 158 428 Read N Characters Given Read4 II - Call multiple times Serialize and Deserialize N-ary Tree 33.8% 59.4% Hard Hard 0.05800594958851697 0.06136894637629212 https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree
18 935 158 Knight Dialer Read N Characters Given Read4 II - Call multiple times 45.2% 33.8% Medium Hard 0.04445176257083384 0.05800594958851697 https://leetcode.com/problems/knight-dialer https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times
19 261 935 Graph Valid Tree Knight Dialer 42.2% 45.2% Medium Medium 0.03683657735649026 0.04445176257083384 https://leetcode.com/problems/graph-valid-tree https://leetcode.com/problems/knight-dialer
20 698 261 Partition to K Equal Sum Subsets Graph Valid Tree 45.0% 42.2% Medium Medium 0.02109782896463587 0.03683657735649026 https://leetcode.com/problems/partition-to-k-equal-sum-subsets https://leetcode.com/problems/graph-valid-tree
21 392 698 Is Subsequence Partition to K Equal Sum Subsets 49.2% 45.0% Easy Medium 0.02033508842008217 0.02109782896463587 https://leetcode.com/problems/is-subsequence https://leetcode.com/problems/partition-to-k-equal-sum-subsets
22 341 392 Flatten Nested List Iterator Is Subsequence 52.9% 49.2% Medium Easy 0.019980684690483426 0.02033508842008217 https://leetcode.com/problems/flatten-nested-list-iterator https://leetcode.com/problems/is-subsequence
23 202 341 Happy Number Flatten Nested List Iterator 50.4% 52.9% Easy Medium 0.014045174703047602 0.019980684690483426 https://leetcode.com/problems/happy-number https://leetcode.com/problems/flatten-nested-list-iterator
24 986 202 Interval List Intersections Happy Number 67.3% 50.4% Medium Easy 0.011969023795320735 0.014045174703047602 https://leetcode.com/problems/interval-list-intersections https://leetcode.com/problems/happy-number
25 146 986 LRU Cache Interval List Intersections 33.2% 67.3% Medium Medium 0.010321192540274932 0.011969023795320735 https://leetcode.com/problems/lru-cache https://leetcode.com/problems/interval-list-intersections
26 380 146 Insert Delete GetRandom O(1) LRU Cache 47.5% 33.2% Medium Medium 0.009820849864094454 0.010321192540274932 https://leetcode.com/problems/insert-delete-getrandom-o1 https://leetcode.com/problems/lru-cache
27 208 380 Implement Trie (Prefix Tree) Insert Delete GetRandom O(1) 49.4% 47.5% Medium Medium 0.009105457856626612 0.009820849864094454 https://leetcode.com/problems/implement-trie-prefix-tree https://leetcode.com/problems/insert-delete-getrandom-o1
28 295 208 Find Median from Data Stream Implement Trie (Prefix Tree) 44.3% 49.4% Hard Medium 0.00899893586856953 0.009105457856626612 https://leetcode.com/problems/find-median-from-data-stream https://leetcode.com/problems/implement-trie-prefix-tree
29 239 295 Sliding Window Maximum Find Median from Data Stream 43.0% 44.3% Hard Hard 0.007898935224534491 0.00899893586856953 https://leetcode.com/problems/sliding-window-maximum https://leetcode.com/problems/find-median-from-data-stream
30 14 239 Longest Common Prefix Sliding Window Maximum 35.4% 43.0% Easy Hard 0.00745530292090591 0.007898935224534491 https://leetcode.com/problems/longest-common-prefix https://leetcode.com/problems/sliding-window-maximum
31 36 14 Valid Sudoku Longest Common Prefix 48.7% 35.4% Medium Easy 0.007258242715805398 0.00745530292090591 https://leetcode.com/problems/valid-sudoku https://leetcode.com/problems/longest-common-prefix
32 127 36 Word Ladder Valid Sudoku 29.6% 48.7% Medium Medium 0.005979091056058075 0.007258242715805398 https://leetcode.com/problems/word-ladder https://leetcode.com/problems/valid-sudoku
33 91 127 Decode Ways Word Ladder 24.7% 29.6% Medium Medium 0.005968385368349129 0.005979091056058075 https://leetcode.com/problems/decode-ways https://leetcode.com/problems/word-ladder
34 236 91 Lowest Common Ancestor of a Binary Tree Decode Ways 45.7% 24.7% Medium Medium 0.004714210262726446 0.005968385368349129 https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree https://leetcode.com/problems/decode-ways
35 139 236 Word Break Lowest Common Ancestor of a Binary Tree 40.1% 45.7% Medium Medium 0.003894465052690167 0.004714210262726446 https://leetcode.com/problems/word-break https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
36 79 139 Word Search Word Break 35.6% 40.1% Medium Medium 0.003741741363018696 0.003894465052690167 https://leetcode.com/problems/word-search https://leetcode.com/problems/word-break
37 56 79 Merge Intervals Word Search 39.3% 35.6% Medium Medium 0.0034728286335985107 0.003741741363018696 https://leetcode.com/problems/merge-intervals https://leetcode.com/problems/word-search
38 140 56 Word Break II Merge Intervals 32.6% 39.3% Hard Medium 0.0027070942357783584 0.0034728286335985107 https://leetcode.com/problems/word-break-ii https://leetcode.com/problems/merge-intervals
39 621 140 Task Scheduler Word Break II 50.1% 32.6% Medium Hard 0.002341784338144407 0.0027070942357783584 https://leetcode.com/problems/task-scheduler https://leetcode.com/problems/word-break-ii
40 210 621 Course Schedule II Task Scheduler 40.7% 50.1% Medium Medium 0.0019086707135282834 0.002341784338144407 https://leetcode.com/problems/course-schedule-ii https://leetcode.com/problems/task-scheduler
41 210 Course Schedule II 40.7% Medium 0.0019086707135282834 https://leetcode.com/problems/course-schedule-ii