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

1.7 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21228Missing Number In Arithmetic Progression52.6%Easy0.13219868307194554https://leetcode.com/problems/missing-number-in-arithmetic-progression
3545Boundary of Binary Tree38.9%Medium0.0877756108823857https://leetcode.com/problems/boundary-of-binary-tree
4200Number of Islands46.8%Medium0.04335253869282585https://leetcode.com/problems/number-of-islands
5472Concatenated Words43.7%Hard0.026615010757229714https://leetcode.com/problems/concatenated-words
6140Word Break II32.6%Hard0.023829562832983903https://leetcode.com/problems/word-break-ii
7937Reorder Data in Log Files54.3%Easy0.017971729704467775https://leetcode.com/problems/reorder-data-in-log-files
823Merge k Sorted Lists40.2%Hard0.015414563401186755https://leetcode.com/problems/merge-k-sorted-lists
973Set Matrix Zeroes43.1%Medium0.015010288493889185https://leetcode.com/problems/set-matrix-zeroes
10139Word Break40.1%Medium0.014936797494510552https://leetcode.com/problems/word-break
11101Symmetric Tree46.8%Easy0.013003027580387157https://leetcode.com/problems/symmetric-tree
121Two Sum45.6%Easy0.009584050515388142https://leetcode.com/problems/two-sum
1342Trapping Rain Water48.9%Hard0.009245058144051103https://leetcode.com/problems/trapping-rain-water
14121Best Time to Buy and Sell Stock50.5%Easy0.008128473936202515https://leetcode.com/problems/best-time-to-buy-and-sell-stock
15127Word Ladder29.6%Medium0.005731495844689608https://leetcode.com/problems/word-ladder
1620Valid Parentheses39.0%Easy0.002197682330605871https://leetcode.com/problems/valid-parentheses
171200Minimum Absolute Difference66.6%Easy0https://leetcode.com/problems/minimum-absolute-difference