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

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2388Longest Absolute File Path41.8%Medium0.09792469558666919https://leetcode.com/problems/longest-absolute-file-path
3900RLE Iterator53.5%Medium0.08010604232504882https://leetcode.com/problems/rle-iterator
4616Add Bold Tag in String43.1%Medium0.05421381659414747https://leetcode.com/problems/add-bold-tag-in-string
5695Max Area of Island62.7%Medium0.028321590863246118https://leetcode.com/problems/max-area-of-island
696Unique Binary Search Trees52.9%Medium0.02067613283842731https://leetcode.com/problems/unique-binary-search-trees
737Sudoku Solver43.6%Hard0.01821543989134118https://leetcode.com/problems/sudoku-solver
8314Binary Tree Vertical Order Traversal45.3%Medium0.018010392274465332https://leetcode.com/problems/binary-tree-vertical-order-traversal
9239Sliding Window Maximum43.0%Hard0.01768566434627554https://leetcode.com/problems/sliding-window-maximum
10340Longest Substring with At Most K Distinct Characters44.1%Hard0.016122880486563188https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters
11528Random Pick with Weight43.9%Medium0.014831565905995232https://leetcode.com/problems/random-pick-with-weight
1241First Missing Positive32.0%Hard0.014368063266920193https://leetcode.com/problems/first-missing-positive
13172Factorial Trailing Zeroes37.8%Easy0.012326812480658571https://leetcode.com/problems/factorial-trailing-zeroes
14153Find Minimum in Rotated Sorted Array45.1%Medium0.008430963288799368https://leetcode.com/problems/find-minimum-in-rotated-sorted-array
156ZigZag Conversion36.3%Medium0.0077116248757144665https://leetcode.com/problems/zigzag-conversion
16200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
1764Minimum Path Sum54.5%Medium0.006127470152097104https://leetcode.com/problems/minimum-path-sum
18207Course Schedule43.1%Medium0.004964021114211758https://leetcode.com/problems/course-schedule
19155Min Stack44.5%Easy0.00474891074128171https://leetcode.com/problems/min-stack
2023Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
2149Group Anagrams56.9%Medium0.0038040939835560453https://leetcode.com/problems/group-anagrams