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