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,22 +1,23 @@
759,Employee Free Time,66.3%,Hard,1.429184272146321, https://leetcode.com/problems/employee-free-time
1359,Count All Valid Pickup and Delivery Options,57.9%,Hard,1.2093743507330705, https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options
695,Max Area of Island,62.7%,Medium,1.0938588036906711, https://leetcode.com/problems/max-area-of-island
1229,Meeting Scheduler,52.7%,Medium,0.7486612660050764, https://leetcode.com/problems/meeting-scheduler
355,Design Twitter,30.3%,Medium,0.6726996677085982, https://leetcode.com/problems/design-twitter
121,Best Time to Buy and Sell Stock,50.5%,Easy,0.3275021300230036, https://leetcode.com/problems/best-time-to-buy-and-sell-stock
227,Basic Calculator II,36.9%,Medium,0.14222709959207652, https://leetcode.com/problems/basic-calculator-ii
210,Course Schedule II,40.7%,Medium,0.12930146274938759, https://leetcode.com/problems/course-schedule-ii
1174,Immediate Food Delivery II,58.5%,Medium,0.12555653398976382, https://leetcode.com/problems/immediate-food-delivery-ii
56,Merge Intervals,39.3%,Medium,0.06807635025869622, https://leetcode.com/problems/merge-intervals
1173,Immediate Food Delivery I,80.4%,Easy,0.06592172080482424, https://leetcode.com/problems/immediate-food-delivery-i
37,Sudoku Solver,43.6%,Hard,0.040527833612118376, https://leetcode.com/problems/sudoku-solver
528,Random Pick with Weight,43.9%,Medium,0.03306693626657339, https://leetcode.com/problems/random-pick-with-weight
15,3Sum,26.8%,Medium,0.02661031301111795, https://leetcode.com/problems/3sum
348,Design Tic-Tac-Toe,54.3%,Medium,0.024214258120594613, https://leetcode.com/problems/design-tic-tac-toe
269,Alien Dictionary,33.3%,Hard,0.012730916694039954, https://leetcode.com/problems/alien-dictionary
986,Interval List Intersections,67.3%,Medium,0.011969023795320735, https://leetcode.com/problems/interval-list-intersections
200,Number of Islands,46.8%,Medium,0.011509262420590827, https://leetcode.com/problems/number-of-islands
146,LRU Cache,33.2%,Medium,0.010321192540274932, https://leetcode.com/problems/lru-cache
36,Valid Sudoku,48.7%,Medium,0.007258242715805398, https://leetcode.com/problems/valid-sudoku
20,Valid Parentheses,39.0%,Easy,0.0023005704055949323, https://leetcode.com/problems/valid-parentheses
772,Basic Calculator III,41.3%,Hard,0, https://leetcode.com/problems/basic-calculator-iii
ID,Title,Acceptance,Difficulty,Frequency,Leetcode Question Link
759,Employee Free Time,66.3%,Hard,1.429184272146321, https://leetcode.com/problems/employee-free-time
1359,Count All Valid Pickup and Delivery Options,57.9%,Hard,1.2093743507330705, https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options
695,Max Area of Island,62.7%,Medium,1.0938588036906711, https://leetcode.com/problems/max-area-of-island
1229,Meeting Scheduler,52.7%,Medium,0.7486612660050764, https://leetcode.com/problems/meeting-scheduler
355,Design Twitter,30.3%,Medium,0.6726996677085982, https://leetcode.com/problems/design-twitter
121,Best Time to Buy and Sell Stock,50.5%,Easy,0.3275021300230036, https://leetcode.com/problems/best-time-to-buy-and-sell-stock
227,Basic Calculator II,36.9%,Medium,0.14222709959207652, https://leetcode.com/problems/basic-calculator-ii
210,Course Schedule II,40.7%,Medium,0.12930146274938759, https://leetcode.com/problems/course-schedule-ii
1174,Immediate Food Delivery II,58.5%,Medium,0.12555653398976382, https://leetcode.com/problems/immediate-food-delivery-ii
56,Merge Intervals,39.3%,Medium,0.06807635025869622, https://leetcode.com/problems/merge-intervals
1173,Immediate Food Delivery I,80.4%,Easy,0.06592172080482424, https://leetcode.com/problems/immediate-food-delivery-i
37,Sudoku Solver,43.6%,Hard,0.040527833612118376, https://leetcode.com/problems/sudoku-solver
528,Random Pick with Weight,43.9%,Medium,0.03306693626657339, https://leetcode.com/problems/random-pick-with-weight
15,3Sum,26.8%,Medium,0.02661031301111795, https://leetcode.com/problems/3sum
348,Design Tic-Tac-Toe,54.3%,Medium,0.024214258120594613, https://leetcode.com/problems/design-tic-tac-toe
269,Alien Dictionary,33.3%,Hard,0.012730916694039954, https://leetcode.com/problems/alien-dictionary
986,Interval List Intersections,67.3%,Medium,0.011969023795320735, https://leetcode.com/problems/interval-list-intersections
200,Number of Islands,46.8%,Medium,0.011509262420590827, https://leetcode.com/problems/number-of-islands
146,LRU Cache,33.2%,Medium,0.010321192540274932, https://leetcode.com/problems/lru-cache
36,Valid Sudoku,48.7%,Medium,0.007258242715805398, https://leetcode.com/problems/valid-sudoku
20,Valid Parentheses,39.0%,Easy,0.0023005704055949323, https://leetcode.com/problems/valid-parentheses
772,Basic Calculator III,41.3%,Hard,0, https://leetcode.com/problems/basic-calculator-iii
1 759 ID Employee Free Time Title 66.3% Acceptance Hard Difficulty 1.429184272146321 Frequency https://leetcode.com/problems/employee-free-time Leetcode Question Link
2 1359 759 Count All Valid Pickup and Delivery Options Employee Free Time 57.9% 66.3% Hard Hard 1.2093743507330705 1.429184272146321 https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options https://leetcode.com/problems/employee-free-time
3 695 1359 Max Area of Island Count All Valid Pickup and Delivery Options 62.7% 57.9% Medium Hard 1.0938588036906711 1.2093743507330705 https://leetcode.com/problems/max-area-of-island https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options
4 1229 695 Meeting Scheduler Max Area of Island 52.7% 62.7% Medium Medium 0.7486612660050764 1.0938588036906711 https://leetcode.com/problems/meeting-scheduler https://leetcode.com/problems/max-area-of-island
5 355 1229 Design Twitter Meeting Scheduler 30.3% 52.7% Medium Medium 0.6726996677085982 0.7486612660050764 https://leetcode.com/problems/design-twitter https://leetcode.com/problems/meeting-scheduler
6 121 355 Best Time to Buy and Sell Stock Design Twitter 50.5% 30.3% Easy Medium 0.3275021300230036 0.6726996677085982 https://leetcode.com/problems/best-time-to-buy-and-sell-stock https://leetcode.com/problems/design-twitter
7 227 121 Basic Calculator II Best Time to Buy and Sell Stock 36.9% 50.5% Medium Easy 0.14222709959207652 0.3275021300230036 https://leetcode.com/problems/basic-calculator-ii https://leetcode.com/problems/best-time-to-buy-and-sell-stock
8 210 227 Course Schedule II Basic Calculator II 40.7% 36.9% Medium Medium 0.12930146274938759 0.14222709959207652 https://leetcode.com/problems/course-schedule-ii https://leetcode.com/problems/basic-calculator-ii
9 1174 210 Immediate Food Delivery II Course Schedule II 58.5% 40.7% Medium Medium 0.12555653398976382 0.12930146274938759 https://leetcode.com/problems/immediate-food-delivery-ii https://leetcode.com/problems/course-schedule-ii
10 56 1174 Merge Intervals Immediate Food Delivery II 39.3% 58.5% Medium Medium 0.06807635025869622 0.12555653398976382 https://leetcode.com/problems/merge-intervals https://leetcode.com/problems/immediate-food-delivery-ii
11 1173 56 Immediate Food Delivery I Merge Intervals 80.4% 39.3% Easy Medium 0.06592172080482424 0.06807635025869622 https://leetcode.com/problems/immediate-food-delivery-i https://leetcode.com/problems/merge-intervals
12 37 1173 Sudoku Solver Immediate Food Delivery I 43.6% 80.4% Hard Easy 0.040527833612118376 0.06592172080482424 https://leetcode.com/problems/sudoku-solver https://leetcode.com/problems/immediate-food-delivery-i
13 528 37 Random Pick with Weight Sudoku Solver 43.9% 43.6% Medium Hard 0.03306693626657339 0.040527833612118376 https://leetcode.com/problems/random-pick-with-weight https://leetcode.com/problems/sudoku-solver
14 15 528 3Sum Random Pick with Weight 26.8% 43.9% Medium Medium 0.02661031301111795 0.03306693626657339 https://leetcode.com/problems/3sum https://leetcode.com/problems/random-pick-with-weight
15 348 15 Design Tic-Tac-Toe 3Sum 54.3% 26.8% Medium Medium 0.024214258120594613 0.02661031301111795 https://leetcode.com/problems/design-tic-tac-toe https://leetcode.com/problems/3sum
16 269 348 Alien Dictionary Design Tic-Tac-Toe 33.3% 54.3% Hard Medium 0.012730916694039954 0.024214258120594613 https://leetcode.com/problems/alien-dictionary https://leetcode.com/problems/design-tic-tac-toe
17 986 269 Interval List Intersections Alien Dictionary 67.3% 33.3% Medium Hard 0.011969023795320735 0.012730916694039954 https://leetcode.com/problems/interval-list-intersections https://leetcode.com/problems/alien-dictionary
18 200 986 Number of Islands Interval List Intersections 46.8% 67.3% Medium Medium 0.011509262420590827 0.011969023795320735 https://leetcode.com/problems/number-of-islands https://leetcode.com/problems/interval-list-intersections
19 146 200 LRU Cache Number of Islands 33.2% 46.8% Medium Medium 0.010321192540274932 0.011509262420590827 https://leetcode.com/problems/lru-cache https://leetcode.com/problems/number-of-islands
20 36 146 Valid Sudoku LRU Cache 48.7% 33.2% Medium Medium 0.007258242715805398 0.010321192540274932 https://leetcode.com/problems/valid-sudoku https://leetcode.com/problems/lru-cache
21 20 36 Valid Parentheses Valid Sudoku 39.0% 48.7% Easy Medium 0.0023005704055949323 0.007258242715805398 https://leetcode.com/problems/valid-parentheses https://leetcode.com/problems/valid-sudoku
22 772 20 Basic Calculator III Valid Parentheses 41.3% 39.0% Hard Easy 0 0.0023005704055949323 https://leetcode.com/problems/basic-calculator-iii https://leetcode.com/problems/valid-parentheses
23 772 Basic Calculator III 41.3% Hard 0 https://leetcode.com/problems/basic-calculator-iii