LeetCode-Questions-CompanyWise/intuit_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.3 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2811Subdomain Visit Count69.9%Easy1.9114226190593886https://leetcode.com/problems/subdomain-visit-count
368Text Justification27.7%Hard1.4123664441789625https://leetcode.com/problems/text-justification
4770Basic Calculator IV48.1%Hard0.8215540873621219https://leetcode.com/problems/basic-calculator-iv
5224Basic Calculator36.8%Hard0.23074173054528113https://leetcode.com/problems/basic-calculator
6729My Calendar I51.8%Medium0.20856657856743668https://leetcode.com/problems/my-calendar-i
7718Maximum Length of Repeated Subarray49.4%Medium0.16528289916664798https://leetcode.com/problems/maximum-length-of-repeated-subarray
879Word Search35.6%Medium0.1400806259250934https://leetcode.com/problems/word-search
9759Employee Free Time66.3%Hard0.10623186692973738https://leetcode.com/problems/employee-free-time
10409Longest Palindrome50.3%Easy0.09593930848188609https://leetcode.com/problems/longest-palindrome
11207Course Schedule43.1%Medium0.05917457139647936https://leetcode.com/problems/course-schedule
12210Course Schedule II40.7%Medium0.046656780240426174https://leetcode.com/problems/course-schedule-ii
13146LRU Cache33.2%Medium0.040660598211268925https://leetcode.com/problems/lru-cache
14227Basic Calculator II36.9%Medium0.01239941490503826https://leetcode.com/problems/basic-calculator-ii
15236Lowest Common Ancestor of a Binary Tree45.7%Medium0.010575891759058162https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
1672Edit Distance44.8%Hard0.010017614452317782https://leetcode.com/problems/edit-distance
1720Valid Parentheses39.0%Easy0.009170695326061695https://leetcode.com/problems/valid-parentheses
1856Merge Intervals39.3%Medium0.007796972706004796https://leetcode.com/problems/merge-intervals
19124Binary Tree Maximum Path Sum34.3%Hard0.005531752454833179https://leetcode.com/problems/binary-tree-maximum-path-sum
20287Find the Duplicate Number55.5%Medium0.005501320434837602https://leetcode.com/problems/find-the-duplicate-number
21155Min Stack44.5%Easy0.00474891074128171https://leetcode.com/problems/min-stack
2249Group Anagrams56.9%Medium0.0038040939835560453https://leetcode.com/problems/group-anagrams
231Two Sum45.6%Easy0.00184543512358731https://leetcode.com/problems/two-sum