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

2.0 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2735Asteroid Collision41.0%Medium0.4807449678769452https://leetcode.com/problems/asteroid-collision
3365Water and Jug Problem30.6%Medium0.36154113358990525https://leetcode.com/problems/water-and-jug-problem
4981Time Based Key-Value Store53.1%Medium0.24353082235287765https://leetcode.com/problems/time-based-key-value-store
5238Product of Array Except Self60.1%Medium0.22477655808124566https://leetcode.com/problems/product-of-array-except-self
6158Read N Characters Given Read4 II - Call multiple times33.8%Hard0.21421194491522716https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times
7642Design Search Autocomplete System44.7%Hard0.09500811062818718https://leetcode.com/problems/design-search-autocomplete-system
8716Max Stack42.6%Easy0.09362342046209744https://leetcode.com/problems/max-stack
9304Range Sum Query 2D - Immutable38.6%Medium0.054527987071175225https://leetcode.com/problems/range-sum-query-2d-immutable
10127Word Ladder29.6%Medium0.03679590970204585https://leetcode.com/problems/word-ladder
1191Decode Ways24.7%Medium0.023662742620848144https://leetcode.com/problems/decode-ways
12567Permutation in String44.4%Medium0.014947961435873182https://leetcode.com/problems/permutation-in-string
13109Convert Sorted List to Binary Search Tree47.7%Medium0.014440684154794336https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree
1488Merge Sorted Array39.4%Easy0.006760335218638243https://leetcode.com/problems/merge-sorted-array
1576Minimum Window Substring34.6%Hard0.006231520398723243https://leetcode.com/problems/minimum-window-substring
1617Letter Combinations of a Phone Number46.8%Medium0.0044018999217624675https://leetcode.com/problems/letter-combinations-of-a-phone-number
1723Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
1820Valid Parentheses39.0%Easy0.0023005704055949323https://leetcode.com/problems/valid-parentheses