Files
LeetCode-Questions-CompanyWise/doordash_2year.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.2 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2695Max Area of Island62.7%Medium0.7679307328544888https://leetcode.com/problems/max-area-of-island
3759Employee Free Time66.3%Hard0.754042350785198https://leetcode.com/problems/employee-free-time
41229Meeting Scheduler52.7%Medium0.5152176154540078https://leetcode.com/problems/meeting-scheduler
51359Count All Valid Pickup and Delivery Options57.9%Hard0.4639892692240469https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options
6355Design Twitter30.3%Medium0.43160716401293453https://leetcode.com/problems/design-twitter
7121Best Time to Buy and Sell Stock50.5%Easy0.19278242868174433https://leetcode.com/problems/best-time-to-buy-and-sell-stock
81174Immediate Food Delivery II58.5%Medium0.12555653398976382https://leetcode.com/problems/immediate-food-delivery-ii
9210Course Schedule II40.7%Medium0.10207384808971935https://leetcode.com/problems/course-schedule-ii
10227Basic Calculator II36.9%Medium0.07508779675444797https://leetcode.com/problems/basic-calculator-ii
111173Immediate Food Delivery I80.4%Easy0.06592172080482424https://leetcode.com/problems/immediate-food-delivery-i
12528Random Pick with Weight43.9%Medium0.03306693626657339https://leetcode.com/problems/random-pick-with-weight
13348Design Tic-Tac-Toe54.3%Medium0.024214258120594613https://leetcode.com/problems/design-tic-tac-toe
1437Sudoku Solver43.6%Hard0.01821543989134118https://leetcode.com/problems/sudoku-solver
1556Merge Intervals39.3%Medium0.013819532422258866https://leetcode.com/problems/merge-intervals
16269Alien Dictionary33.3%Hard0.012730916694039954https://leetcode.com/problems/alien-dictionary
1736Valid Sudoku48.7%Medium0.007258242715805398https://leetcode.com/problems/valid-sudoku
18200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
19153Sum26.8%Medium0.004940992758742591https://leetcode.com/problems/3sum
20146LRU Cache33.2%Medium0.004600353139061353https://leetcode.com/problems/lru-cache
2120Valid Parentheses39.0%Easy0.0023005704055949323https://leetcode.com/problems/valid-parentheses