Files
LeetCode-Questions-CompanyWise/indeed_2year.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.6 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2811Subdomain Visit Count69.9%Easy1.538307489545883https://leetcode.com/problems/subdomain-visit-count
3224Basic Calculator36.8%Hard1.1373983137032662https://leetcode.com/problems/basic-calculator
4770Basic Calculator IV48.1%Hard0.9582549309731873https://leetcode.com/problems/basic-calculator-iv
5718Maximum Length of Repeated Subarray49.4%Medium0.6258730735252086https://leetcode.com/problems/maximum-length-of-repeated-subarray
668Text Justification27.7%Hard0.22496389768259162https://leetcode.com/problems/text-justification
7228Summary Ranges39.5%Medium0.1207191114343526https://leetcode.com/problems/summary-ranges
8362Design Hit Counter63.7%Medium0.09787757530957068https://leetcode.com/problems/design-hit-counter
985Maximal Rectangle37.7%Hard0.0805588367172521https://leetcode.com/problems/maximal-rectangle
10346Moving Average from Data Stream70.9%Easy0.06887402901251127https://leetcode.com/problems/moving-average-from-data-stream
111197Minimum Knight Moves36.1%Medium0.06562120535847293https://leetcode.com/problems/minimum-knight-moves
12829Consecutive Numbers Sum37.5%Hard0.05341723749698583https://leetcode.com/problems/consecutive-numbers-sum
13380Insert Delete GetRandom O(1)47.5%Medium0.038717635350707984https://leetcode.com/problems/insert-delete-getrandom-o1
14563Binary Tree Tilt48.7%Easy0.030443751414723153https://leetcode.com/problems/binary-tree-tilt
15349Intersection of Two Arrays62.5%Easy0.028691227482495342https://leetcode.com/problems/intersection-of-two-arrays
16227Basic Calculator II36.9%Medium0.027685557859864054https://leetcode.com/problems/basic-calculator-ii
1723Merge k Sorted Lists40.2%Hard0.016108271385328228https://leetcode.com/problems/merge-k-sorted-lists
1821Merge Two Sorted Lists53.5%Easy0.014012111332134735https://leetcode.com/problems/merge-two-sorted-lists
19724Find Pivot Index44.0%Easy0.013850636933899008https://leetcode.com/problems/find-pivot-index
201143Longest Common Subsequence58.4%Medium0.008835931134362285https://leetcode.com/problems/longest-common-subsequence
21297Serialize and Deserialize Binary Tree47.5%Hard0.007077170374085099https://leetcode.com/problems/serialize-and-deserialize-binary-tree
221Two Sum45.6%Easy0.0051178232035212715https://leetcode.com/problems/two-sum
23560Subarray Sum Equals K43.9%Medium0.004279454482267064https://leetcode.com/problems/subarray-sum-equals-k
2488Merge Sorted Array39.4%Easy0.0030102370714243072https://leetcode.com/problems/merge-sorted-array