LeetCode-Questions-CompanyWise/qualtrics_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

3.0 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2200Number of Islands46.8%Medium0.6743216943898789https://leetcode.com/problems/number-of-islands
3695Max Area of Island62.7%Medium0.5272157745378819https://leetcode.com/problems/max-area-of-island
4449Serialize and Deserialize BST52.0%Medium0.5089777138955178https://leetcode.com/problems/serialize-and-deserialize-bst
542Trapping Rain Water48.9%Hard0.36187179404352093https://leetcode.com/problems/trapping-rain-water
6127Word Ladder29.6%Medium0.29067608666438566https://leetcode.com/problems/word-ladder
7173Binary Search Tree Iterator56.6%Medium0.2676620302183387https://leetcode.com/problems/binary-search-tree-iterator
8138Copy List with Random Pointer36.4%Medium0.2330001096609468https://leetcode.com/problems/copy-list-with-random-pointer
949Group Anagrams56.9%Medium0.19424008455548245https://leetcode.com/problems/group-anagrams
10139Word Break40.1%Medium0.1314440532234174https://leetcode.com/problems/word-break
111041Robot Bounded In Circle49.6%Medium0.10573219378884732https://leetcode.com/problems/robot-bounded-in-circle
12733Flood Fill55.3%Easy0.09669362480247104https://leetcode.com/problems/flood-fill
1313Roman to Integer55.7%Easy0.08237818622149326https://leetcode.com/problems/roman-to-integer
14103Binary Tree Zigzag Level Order Traversal48.3%Medium0.08046023391882479https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
15119Pascal's Triangle II49.0%Easy0.07211890069342013https://leetcode.com/problems/pascals-triangle-ii
16332Reconstruct Itinerary36.7%Medium0.053921416793820044https://leetcode.com/problems/reconstruct-itinerary
17153Sum26.8%Medium0.04361391077370199https://leetcode.com/problems/3sum
18722Remove Comments34.6%Medium0.04049136135473691https://leetcode.com/problems/remove-comments
19729My Calendar I51.8%Medium0.036433902246102004https://leetcode.com/problems/my-calendar-i
20208Implement Trie (Prefix Tree)49.4%Medium0.03593469952792866https://leetcode.com/problems/implement-trie-prefix-tree
21131Palindrome Partitioning47.5%Medium0.03101558050692165https://leetcode.com/problems/palindrome-partitioning
22297Serialize and Deserialize Binary Tree47.5%Hard0.01585377577217724https://leetcode.com/problems/serialize-and-deserialize-binary-tree
23767Reorganize String48.7%Medium0.01329806830463147https://leetcode.com/problems/reorganize-string
24543Diameter of Binary Tree48.4%Easy0.011898606798495848https://leetcode.com/problems/diameter-of-binary-tree
2569Sqrt(x)33.9%Easy0.011443227222342794https://leetcode.com/problems/sqrtx
26295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
27238Product of Array Except Self60.1%Medium0.008821856860216758https://leetcode.com/problems/product-of-array-except-self
2834Find First and Last Position of Element in Sorted Array36.2%Medium0.004247643638268045https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array