Files
LeetCode-Questions-CompanyWise/paypal_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
21473Paint House III48.1%Hard0.3658010975821623https://leetcode.com/problems/paint-house-iii
31497Check If Array Pairs Are Divisible by k41.1%Medium0.2357666456855048https://leetcode.com/problems/check-if-array-pairs-are-divisible-by-k
41041Robot Bounded In Circle49.6%Medium0.10573219378884732https://leetcode.com/problems/robot-bounded-in-circle
51297Maximum Number of Occurrences of a Substring47.3%Medium0.07770898432731625https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring
656Merge Intervals39.3%Medium0.04173304225331761https://leetcode.com/problems/merge-intervals
7324Wiggle Sort II29.9%Medium0.02898753687325229https://leetcode.com/problems/wiggle-sort-ii
868Text Justification27.7%Hard0.0276451606661453https://leetcode.com/problems/text-justification
912Integer to Roman55.1%Medium0.019096697456456382https://leetcode.com/problems/integer-to-roman
1073Set Matrix Zeroes43.1%Medium0.015715357479628243https://leetcode.com/problems/set-matrix-zeroes
11977Squares of a Sorted Array72.1%Easy0.015474196582597383https://leetcode.com/problems/squares-of-a-sorted-array
12227Basic Calculator II36.9%Medium0.01239941490503826https://leetcode.com/problems/basic-calculator-ii
1320Valid Parentheses39.0%Easy0.009170695326061695https://leetcode.com/problems/valid-parentheses
14128Longest Consecutive Sequence45.1%Hard0.009051883485315484https://leetcode.com/problems/longest-consecutive-sequence
15876Middle of the Linked List68.4%Easy0.007624893975696915https://leetcode.com/problems/middle-of-the-linked-list
1653Maximum Subarray46.5%Easy0.004869349014182134https://leetcode.com/problems/maximum-subarray
17146LRU Cache33.2%Medium0.004600353139061353https://leetcode.com/problems/lru-cache
181Two Sum45.6%Easy0.003278422738041615https://leetcode.com/problems/two-sum
192Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers