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

2.0 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2227Basic Calculator II36.9%Medium0.21141874864915486https://leetcode.com/problems/basic-calculator-ii
3727Minimum Window Subsequence41.8%Hard0.15970111035790735https://leetcode.com/problems/minimum-window-subsequence
4304Range Sum Query 2D - Immutable38.6%Medium0.1583948504722182https://leetcode.com/problems/range-sum-query-2d-immutable
5721Accounts Merge48.8%Medium0.15836350116973763https://leetcode.com/problems/accounts-merge
643Multiply Strings33.9%Medium0.10664586287849012https://leetcode.com/problems/multiply-strings
7218The Skyline Problem34.6%Hard0.0564413109049518https://leetcode.com/problems/the-skyline-problem
8556Next Greater Element III31.7%Medium0.04679216150675895https://leetcode.com/problems/next-greater-element-iii
9200Number of Islands46.8%Medium0.04526299408355752https://leetcode.com/problems/number-of-islands
1048Rotate Image56.7%Medium0.04495138786226632https://leetcode.com/problems/rotate-image
11698Partition to K Equal Sum Subsets45.0%Medium0.02109782896463587https://leetcode.com/problems/partition-to-k-equal-sum-subsets
12301Remove Invalid Parentheses43.3%Hard0.01446679841775339https://leetcode.com/problems/remove-invalid-parentheses
1331Next Permutation32.6%Medium0.013427025530888667https://leetcode.com/problems/next-permutation
14120Triangle44.2%Medium0.013236460625830901https://leetcode.com/problems/triangle
15212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
1610Regular Expression Matching26.8%Hard0.0071865203293987245https://leetcode.com/problems/regular-expression-matching
174Median of Two Sorted Arrays29.6%Hard0.003900160950094767https://leetcode.com/problems/median-of-two-sorted-arrays
18660Remove 953.3%Hard0https://leetcode.com/problems/remove-9
19772Basic Calculator III41.3%Hard0https://leetcode.com/problems/basic-calculator-iii