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

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2206Reverse Linked List62.5%Easy0.13873591368953625https://leetcode.com/problems/reverse-linked-list
333Search in Rotated Sorted Array34.5%Medium0.1101693809658871https://leetcode.com/problems/search-in-rotated-sorted-array
4223Rectangle Area37.8%Medium0.10064352577968744https://leetcode.com/problems/rectangle-area
5146LRU Cache33.2%Medium0.08926627755405464https://leetcode.com/problems/lru-cache
648Rotate Image56.7%Medium0.06069974483040549https://leetcode.com/problems/rotate-image
7231Power of Two43.7%Easy0.059357559503279325https://leetcode.com/problems/power-of-two
8200Number of Islands46.8%Medium0.05694938541936198https://leetcode.com/problems/number-of-islands
9706Design HashMap61.3%Easy0.039016652342451774https://leetcode.com/problems/design-hashmap
10939Minimum Area Rectangle51.8%Medium0.03802739558923925https://leetcode.com/problems/minimum-area-rectangle
11199Binary Tree Right Side View54.1%Medium0.034997972754213943https://leetcode.com/problems/binary-tree-right-side-view
121Two Sum45.6%Easy0.03409719244428431https://leetcode.com/problems/two-sum
1370Climbing Stairs47.8%Easy0.03011156054328408https://leetcode.com/problems/climbing-stairs
1464Minimum Path Sum54.5%Medium0.024287775531756203https://leetcode.com/problems/minimum-path-sum
152Add Two Numbers33.9%Medium0.020491663368639005https://leetcode.com/problems/add-two-numbers
1697Interleaving String31.5%Hard0.020471543980187256https://leetcode.com/problems/interleaving-string
1753Maximum Subarray46.5%Easy0.019336728821707075https://leetcode.com/problems/maximum-subarray
1822Generate Parentheses62.7%Medium0.017331456351639924https://leetcode.com/problems/generate-parentheses
1923Merge k Sorted Lists40.2%Hard0.016108271385328228https://leetcode.com/problems/merge-k-sorted-lists
20114Flatten Binary Tree to Linked List49.3%Medium0.015450951155718977https://leetcode.com/problems/flatten-binary-tree-to-linked-list
218String to Integer (atoi)15.4%Medium0.015084664273571906https://leetcode.com/problems/string-to-integer-atoi
22151Reverse Words in a String21.9%Medium0.013753273019471011https://leetcode.com/problems/reverse-words-in-a-string
23739Daily Temperatures63.3%Medium0.010032690121814417https://leetcode.com/problems/daily-temperatures
24415Add Strings47.5%Easy0.007587289812159497https://leetcode.com/problems/add-strings
2542Trapping Rain Water48.9%Hard0.004350670338744988https://leetcode.com/problems/trapping-rain-water