Files
LeetCode-Questions-CompanyWise/pocket-gems_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

887 B

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2740Delete and Earn48.6%Medium0.35086940302246983https://leetcode.com/problems/delete-and-earn
3547Friend Circles58.6%Medium0.21411487503668122https://leetcode.com/problems/friend-circles
41010Pairs of Songs With Total Durations Divisible by 6047.4%Easy0.166463766150424https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60
5366Find Leaves of Binary Tree70.6%Medium0.15413619386178415https://leetcode.com/problems/find-leaves-of-binary-tree
6133Clone Graph34.8%Medium0.017381665875995565https://leetcode.com/problems/clone-graph
710Regular Expression Matching26.8%Hard0.01542711432325032https://leetcode.com/problems/regular-expression-matching
841First Missing Positive32.0%Hard0.006163347707668678https://leetcode.com/problems/first-missing-positive