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

3.2 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2281Zigzag Iterator58.4%Medium0.14442795545557569https://leetcode.com/problems/zigzag-iterator
3487Max Consecutive Ones II48.5%Medium0.10973238837921641https://leetcode.com/problems/max-consecutive-ones-ii
4283Move Zeroes57.8%Easy0.08025517978737091https://leetcode.com/problems/move-zeroes
5125Valid Palindrome36.7%Easy0.04555961271101164https://leetcode.com/problems/valid-palindrome
6933Number of Recent Calls71.9%Easy0.04470017891790688https://leetcode.com/problems/number-of-recent-calls
71004Max Consecutive Ones III59.1%Medium0.039340737501221655https://leetcode.com/problems/max-consecutive-ones-iii
8380Insert Delete GetRandom O(1)47.5%Medium0.03685354875882915https://leetcode.com/problems/insert-delete-getrandom-o1
9228Summary Ranges39.5%Medium0.030145462786142038https://leetcode.com/problems/summary-ranges
1056Merge Intervals39.3%Medium0.029428312930608616https://leetcode.com/problems/merge-intervals
11146LRU Cache33.2%Medium0.027008231238717192https://leetcode.com/problems/lru-cache
1220Valid Parentheses39.0%Easy0.02659442524606294https://leetcode.com/problems/valid-parentheses
1322Generate Parentheses62.7%Medium0.025674032888177357https://leetcode.com/problems/generate-parentheses
1498Validate Binary Search Tree27.8%Medium0.02498915343504624https://leetcode.com/problems/validate-binary-search-tree
1549Group Anagrams56.9%Medium0.02250319980071896https://leetcode.com/problems/group-anagrams
16206Reverse Linked List62.5%Easy0.0199088586407687https://leetcode.com/problems/reverse-linked-list
17567Permutation in String44.4%Medium0.014189666957517671https://leetcode.com/problems/permutation-in-string
18150Evaluate Reverse Polish Notation36.3%Medium0.01355493475171521https://leetcode.com/problems/evaluate-reverse-polish-notation
19443String Compression41.3%Easy0.013342426083839913https://leetcode.com/problems/string-compression
20332Reconstruct Itinerary36.7%Medium0.01310634750530051https://leetcode.com/problems/reconstruct-itinerary
21279Perfect Squares47.4%Medium0.008781615160384712https://leetcode.com/problems/perfect-squares
2223Merge k Sorted Lists40.2%Hard0.008699909875545938https://leetcode.com/problems/merge-k-sorted-lists
2321Merge Two Sorted Lists53.5%Easy0.008604516653304993https://leetcode.com/problems/merge-two-sorted-lists
2488Merge Sorted Array39.4%Easy0.006480904084083141https://leetcode.com/problems/merge-sorted-array
253Longest Substring Without Repeating Characters30.4%Medium0.005927699633275225https://leetcode.com/problems/longest-substring-without-repeating-characters
26350Intersection of Two Arrays II51.4%Easy0.004988163479138952https://leetcode.com/problems/intersection-of-two-arrays-ii
271Two Sum45.6%Easy0.004901297870354067https://leetcode.com/problems/two-sum
28560Subarray Sum Equals K43.9%Medium0.00407664649376343https://leetcode.com/problems/subarray-sum-equals-k
29101Symmetric Tree46.8%Easy0.0032666423495169026https://leetcode.com/problems/symmetric-tree
3033Search in Rotated Sorted Array34.5%Medium0.0031000567336666443https://leetcode.com/problems/search-in-rotated-sorted-array