Files
LeetCode-Questions-CompanyWise/citadel_6months.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

1.7 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2829Consecutive Numbers Sum37.5%Hard0.28481507092935865https://leetcode.com/problems/consecutive-numbers-sum
3285Inorder Successor in BST40.4%Medium0.1850469943157836https://leetcode.com/problems/inorder-successor-in-bst
4241Different Ways to Add Parentheses55.2%Medium0.08527891770220855https://leetcode.com/problems/different-ways-to-add-parentheses
51048Longest String Chain54.7%Medium0.07529425330187599https://leetcode.com/problems/longest-string-chain
6935Knight Dialer45.2%Medium0.04445176257083384https://leetcode.com/problems/knight-dialer
720Valid Parentheses39.0%Easy0.02782373445001039https://leetcode.com/problems/valid-parentheses
8628Maximum Product of Three Numbers47.1%Easy0.016529301951210565https://leetcode.com/problems/maximum-product-of-three-numbers
985Maximal Rectangle37.7%Hard0.013333530869465187https://leetcode.com/problems/maximal-rectangle
10232Implement Queue using Stacks49.6%Easy0.011242389348933884https://leetcode.com/problems/implement-queue-using-stacks
11647Palindromic Substrings60.6%Medium0.010400509768078022https://leetcode.com/problems/palindromic-substrings
12221Maximal Square37.7%Medium0.00988638798855515https://leetcode.com/problems/maximal-square
1342Trapping Rain Water48.9%Hard0.009762524655659178https://leetcode.com/problems/trapping-rain-water
14253Meeting Rooms II45.7%Medium0.008079219870546493https://leetcode.com/problems/meeting-rooms-ii
15239Sliding Window Maximum43.0%Hard0.007898935224534491https://leetcode.com/problems/sliding-window-maximum
16200Number of Islands46.8%Medium0.0028897578265903614https://leetcode.com/problems/number-of-islands