LeetCode-Questions-CompanyWise/roblox_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.8 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2770Basic Calculator IV48.1%Hard0.8056669695056433https://leetcode.com/problems/basic-calculator-iv
3811Subdomain Visit Count69.9%Easy0.6153565614064571https://leetcode.com/problems/subdomain-visit-count
4224Basic Calculator36.8%Hard0.42504615330727086https://leetcode.com/problems/basic-calculator
5829Consecutive Numbers Sum37.5%Hard0.29485791052185223https://leetcode.com/problems/consecutive-numbers-sum
61163Last Substring in Lexicographical Order33.9%Hard0.1912843449600571https://leetcode.com/problems/last-substring-in-lexicographical-order
71297Maximum Number of Occurrences of a Substring47.3%Medium0.1670540846631662https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring
81328Break a Palindrome43.3%Medium0.12838116664820678https://leetcode.com/problems/break-a-palindrome
91248Count Number of Nice Subarrays56.4%Medium0.04593229889743518https://leetcode.com/problems/count-number-of-nice-subarrays
10146LRU Cache33.2%Medium0.028411001832779885https://leetcode.com/problems/lru-cache
111290Convert Binary Number in a Linked List to Integer80.4%Easy0.023623145763435913https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer
1237Sudoku Solver43.6%Hard0.01821543989134118https://leetcode.com/problems/sudoku-solver
13239Sliding Window Maximum43.0%Hard0.01768566434627554https://leetcode.com/problems/sliding-window-maximum
1436Valid Sudoku48.7%Medium0.01625758350956095https://leetcode.com/problems/valid-sudoku
1517Letter Combinations of a Phone Number46.8%Medium0.0044018999217624675https://leetcode.com/problems/letter-combinations-of-a-phone-number
16200Number of Islands46.8%Medium0.0028897578265903614https://leetcode.com/problems/number-of-islands