Files
LeetCode-Questions-CompanyWise/yandex_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.1 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2487Max Consecutive Ones II48.5%Medium0.03644483834479416https://leetcode.com/problems/max-consecutive-ones-ii
3281Zigzag Iterator58.4%Medium0.034926034605810494https://leetcode.com/problems/zigzag-iterator
4283Move Zeroes57.8%Easy0.024557850781664083https://leetcode.com/problems/move-zeroes
5567Permutation in String44.4%Medium0.014189666957517671https://leetcode.com/problems/permutation-in-string
6150Evaluate Reverse Polish Notation36.3%Medium0.01355493475171521https://leetcode.com/problems/evaluate-reverse-polish-notation
756Merge Intervals39.3%Medium0.013186279740090647https://leetcode.com/problems/merge-intervals
8380Insert Delete GetRandom O(1)47.5%Medium0.00934149716911291https://leetcode.com/problems/insert-delete-getrandom-o1
9279Perfect Squares47.4%Medium0.008781615160384712https://leetcode.com/problems/perfect-squares
1098Validate Binary Search Tree27.8%Medium0.0063060747091605324https://leetcode.com/problems/validate-binary-search-tree
1121Merge Two Sorted Lists53.5%Easy0.004849147433009811https://leetcode.com/problems/merge-two-sorted-lists
12146LRU Cache33.2%Medium0.004370636328108912https://leetcode.com/problems/lru-cache
1322Generate Parentheses62.7%Medium0.004152398782798953https://leetcode.com/problems/generate-parentheses
14125Valid Palindrome36.7%Easy0.0037979536727587773https://leetcode.com/problems/valid-palindrome
1549Group Anagrams56.9%Medium0.0036347154963361594https://leetcode.com/problems/group-anagrams
1633Search in Rotated Sorted Array34.5%Medium0.0031000567336666443https://leetcode.com/problems/search-in-rotated-sorted-array
1788Merge Sorted Array39.4%Easy0.002885588497720344https://leetcode.com/problems/merge-sorted-array
18206Reverse Linked List62.5%Easy0.002231770161393673https://leetcode.com/problems/reverse-linked-list
193Longest Substring Without Repeating Characters30.4%Medium0.0014852223137141987https://leetcode.com/problems/longest-substring-without-repeating-characters