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

3.1 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2695Max Area of Island62.7%Medium0.20952332409775687https://leetcode.com/problems/max-area-of-island
3127Word Ladder29.6%Medium0.1667080439422554https://leetcode.com/problems/word-ladder
442Trapping Rain Water48.9%Hard0.12389276378675394https://leetcode.com/problems/trapping-rain-water
51041Robot Bounded In Circle49.6%Medium0.10573219378884732https://leetcode.com/problems/robot-bounded-in-circle
6200Number of Islands46.8%Medium0.09910455319823885https://leetcode.com/problems/number-of-islands
7449Serialize and Deserialize BST52.0%Medium0.08696405427235052https://leetcode.com/problems/serialize-and-deserialize-bst
8139Word Break40.1%Medium0.07605014611885268https://leetcode.com/problems/word-break
9173Binary Search Tree Iterator56.6%Medium0.07392527369701565https://leetcode.com/problems/binary-search-tree-iterator
10103Binary Tree Zigzag Level Order Traversal48.3%Medium0.0697534935244004https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
11138Copy List with Random Pointer36.4%Medium0.05438585262874796https://leetcode.com/problems/copy-list-with-random-pointer
1213Roman to Integer55.7%Easy0.04121346863130292https://leetcode.com/problems/roman-to-integer
13722Remove Comments34.6%Medium0.04049136135473691https://leetcode.com/problems/remove-comments
14729My Calendar I51.8%Medium0.036433902246102004https://leetcode.com/problems/my-calendar-i
15332Reconstruct Itinerary36.7%Medium0.030687713231237448https://leetcode.com/problems/reconstruct-itinerary
16119Pascal's Triangle II49.0%Easy0.026565907037593445https://leetcode.com/problems/pascals-triangle-ii
17733Flood Fill55.3%Easy0.02506396866321625https://leetcode.com/problems/flood-fill
18131Palindrome Partitioning47.5%Medium0.013903595538577326https://leetcode.com/problems/palindrome-partitioning
19767Reorganize String48.7%Medium0.01329806830463147https://leetcode.com/problems/reorganize-string
20208Implement Trie (Prefix Tree)49.4%Medium0.009105457856626612https://leetcode.com/problems/implement-trie-prefix-tree
21295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
22238Product of Array Except Self60.1%Medium0.008821856860216758https://leetcode.com/problems/product-of-array-except-self
23153Sum26.8%Medium0.00876717944353383https://leetcode.com/problems/3sum
24297Serialize and Deserialize Binary Tree47.5%Hard0.007077170374085099https://leetcode.com/problems/serialize-and-deserialize-binary-tree
25543Diameter of Binary Tree48.4%Easy0.005305755914149804https://leetcode.com/problems/diameter-of-binary-tree
2669Sqrt(x)33.9%Easy0.005102051883895465https://leetcode.com/problems/sqrtx
2734Find 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
2849Group Anagrams56.9%Medium0.0038040939835560453https://leetcode.com/problems/group-anagrams