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

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2811Subdomain Visit Count69.9%Easy3.0230924503622614https://leetcode.com/problems/subdomain-visit-count
3770Basic Calculator IV48.1%Hard2.277267285009756https://leetcode.com/problems/basic-calculator-iv
468Text Justification27.7%Hard1.8708853641098548https://leetcode.com/problems/text-justification
5224Basic Calculator36.8%Hard1.204714054955524https://leetcode.com/problems/basic-calculator
6718Maximum Length of Repeated Subarray49.4%Medium0.45888888960301877https://leetcode.com/problems/maximum-length-of-repeated-subarray
7729My Calendar I51.8%Medium0.3746934494414107https://leetcode.com/problems/my-calendar-i
8146LRU Cache33.2%Medium0.3479336801402196https://leetcode.com/problems/lru-cache
9207Course Schedule43.1%Medium0.27648500804356096https://leetcode.com/problems/course-schedule
10227Basic Calculator II36.9%Medium0.18200959297922678https://leetcode.com/problems/basic-calculator-ii
11759Employee Free Time66.3%Hard0.1816986978513639https://leetcode.com/problems/employee-free-time
1279Word Search35.6%Medium0.16863563907781756https://leetcode.com/problems/word-search
13409Longest Palindrome50.3%Easy0.1461170580676051https://leetcode.com/problems/longest-palindrome
141Two Sum45.6%Easy0.10307155038394701https://leetcode.com/problems/two-sum
1556Merge Intervals39.3%Medium0.08339552430579078https://leetcode.com/problems/merge-intervals
16210Course Schedule II40.7%Medium0.07762595476606639https://leetcode.com/problems/course-schedule-ii
17124Binary Tree Maximum Path Sum34.3%Hard0.06574255262249057https://leetcode.com/problems/binary-tree-maximum-path-sum
18695Max Area of Island62.7%Medium0.04980799142417255https://leetcode.com/problems/max-area-of-island
1920Valid Parentheses39.0%Easy0.02782373445001039https://leetcode.com/problems/valid-parentheses
20236Lowest Common Ancestor of a Binary Tree45.7%Medium0.018724947332324816https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
21155Min Stack44.5%Easy0.010653509851791077https://leetcode.com/problems/min-stack
2272Edit Distance44.8%Hard0.010017614452317782https://leetcode.com/problems/edit-distance
23287Find the Duplicate Number55.5%Medium0.005501320434837602https://leetcode.com/problems/find-the-duplicate-number
2449Group Anagrams56.9%Medium0.0038040939835560453https://leetcode.com/problems/group-anagrams
25628Maximum Product of Three Numbers47.1%Easy0https://leetcode.com/problems/maximum-product-of-three-numbers