Files
LeetCode-Questions-CompanyWise/doordash_alltime.csv
Krishna Kumar Dey fb5f78b55e 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)

```
2023-04-01 11:07:49 +05:30

2.4 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2759Employee Free Time66.3%Hard1.429184272146321https://leetcode.com/problems/employee-free-time
31359Count All Valid Pickup and Delivery Options57.9%Hard1.2093743507330705https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options
4695Max Area of Island62.7%Medium1.0938588036906711https://leetcode.com/problems/max-area-of-island
51229Meeting Scheduler52.7%Medium0.7486612660050764https://leetcode.com/problems/meeting-scheduler
6355Design Twitter30.3%Medium0.6726996677085982https://leetcode.com/problems/design-twitter
7121Best Time to Buy and Sell Stock50.5%Easy0.3275021300230036https://leetcode.com/problems/best-time-to-buy-and-sell-stock
8227Basic Calculator II36.9%Medium0.14222709959207652https://leetcode.com/problems/basic-calculator-ii
9210Course Schedule II40.7%Medium0.12930146274938759https://leetcode.com/problems/course-schedule-ii
101174Immediate Food Delivery II58.5%Medium0.12555653398976382https://leetcode.com/problems/immediate-food-delivery-ii
1156Merge Intervals39.3%Medium0.06807635025869622https://leetcode.com/problems/merge-intervals
121173Immediate Food Delivery I80.4%Easy0.06592172080482424https://leetcode.com/problems/immediate-food-delivery-i
1337Sudoku Solver43.6%Hard0.040527833612118376https://leetcode.com/problems/sudoku-solver
14528Random Pick with Weight43.9%Medium0.03306693626657339https://leetcode.com/problems/random-pick-with-weight
15153Sum26.8%Medium0.02661031301111795https://leetcode.com/problems/3sum
16348Design Tic-Tac-Toe54.3%Medium0.024214258120594613https://leetcode.com/problems/design-tic-tac-toe
17269Alien Dictionary33.3%Hard0.012730916694039954https://leetcode.com/problems/alien-dictionary
18986Interval List Intersections67.3%Medium0.011969023795320735https://leetcode.com/problems/interval-list-intersections
19200Number of Islands46.8%Medium0.011509262420590827https://leetcode.com/problems/number-of-islands
20146LRU Cache33.2%Medium0.010321192540274932https://leetcode.com/problems/lru-cache
2136Valid Sudoku48.7%Medium0.007258242715805398https://leetcode.com/problems/valid-sudoku
2220Valid Parentheses39.0%Easy0.0023005704055949323https://leetcode.com/problems/valid-parentheses
23772Basic Calculator III41.3%Hard0https://leetcode.com/problems/basic-calculator-iii