LeetCode-Questions-CompanyWise/vmware_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.7 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2146LRU Cache33.2%Medium0.06230548855614676https://leetcode.com/problems/lru-cache
3981Time Based Key-Value Store53.1%Medium0.049406315387071284https://leetcode.com/problems/time-based-key-value-store
497Interleaving String31.5%Hard0.04548535439411653https://leetcode.com/problems/interleaving-string
5706Design HashMap61.3%Easy0.039016652342451774https://leetcode.com/problems/design-hashmap
6697Degree of an Array53.8%Easy0.03226086221822144https://leetcode.com/problems/degree-of-an-array
71048Longest String Chain54.7%Medium0.019361689049145963https://leetcode.com/problems/longest-string-chain
880Remove Duplicates from Sorted Array II44.0%Medium0.014815085785140639https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii
920Valid Parentheses39.0%Easy0.014292491180025941https://leetcode.com/problems/valid-parentheses
10150Evaluate Reverse Polish Notation36.3%Medium0.01413451093490476https://leetcode.com/problems/evaluate-reverse-polish-notation
1156Merge Intervals39.3%Medium0.013819532422258866https://leetcode.com/problems/merge-intervals
12733Flood Fill55.3%Easy0.011217167530924988https://leetcode.com/problems/flood-fill
13905Sort Array By Parity74.1%Easy0.009603915354180344https://leetcode.com/problems/sort-array-by-parity
1463Unique Paths II34.6%Medium0.008712753874961187https://leetcode.com/problems/unique-paths-ii
1549Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
1623Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
17977Squares of a Sorted Array72.1%Easy0.003891055492966611https://leetcode.com/problems/squares-of-a-sorted-array
188String to Integer (atoi)15.4%Medium0.0037925521897059712https://leetcode.com/problems/string-to-integer-atoi
193Longest Substring Without Repeating Characters30.4%Medium0.003496778759264278https://leetcode.com/problems/longest-substring-without-repeating-characters
201Two Sum45.6%Easy0.003278422738041615https://leetcode.com/problems/two-sum
2133Search in Rotated Sorted Array34.5%Medium0.003229976968332634https://leetcode.com/problems/search-in-rotated-sorted-array
2298Validate Binary Search Tree27.8%Medium0.002943776044013381https://leetcode.com/problems/validate-binary-search-tree
2321Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
24153Sum26.8%Medium0.0021990113314367685https://leetcode.com/problems/3sum
252Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers