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

4.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2364Nested List Weight Sum II62.8%Medium0.3957679254185175https://leetcode.com/problems/nested-list-weight-sum-ii
3272Closest Binary Search Tree Value II50.5%Hard0.3195226783074397https://leetcode.com/problems/closest-binary-search-tree-value-ii
4244Shortest Word Distance II52.3%Medium0.2752286113804943https://leetcode.com/problems/shortest-word-distance-ii
5716Max Stack42.6%Easy0.24108416003009112https://leetcode.com/problems/max-stack
6254Factor Combinations46.7%Medium0.21357410029805904https://leetcode.com/problems/factor-combinations
7339Nested List Weight Sum74.0%Easy0.17212701881436038https://leetcode.com/problems/nested-list-weight-sum
8149Max Points on a Line16.9%Hard0.09588177170328253https://leetcode.com/problems/max-points-on-a-line
9605Can Place Flowers31.6%Easy0.09485779345867706https://leetcode.com/problems/can-place-flowers
10698Partition to K Equal Sum Subsets45.0%Medium0.08184524810424337https://leetcode.com/problems/partition-to-k-equal-sum-subsets
11470Implement Rand10() Using Rand7()46.3%Medium0.07020425867324853https://leetcode.com/problems/implement-rand10-using-rand7
12432All O`one Data Structure32.4%Hard0.06887402901251127https://leetcode.com/problems/all-oone-data-structure
13671Second Minimum Node In a Binary Tree42.7%Easy0.06538275926285174https://leetcode.com/problems/second-minimum-node-in-a-binary-tree
14380Insert Delete GetRandom O(1)47.5%Medium0.05985510621029109https://leetcode.com/problems/insert-delete-getrandom-o1
15366Find Leaves of Binary Tree70.6%Medium0.05526267867504946https://leetcode.com/problems/find-leaves-of-binary-tree
16297Serialize and Deserialize Binary Tree47.5%Hard0.04343222127606201https://leetcode.com/problems/serialize-and-deserialize-binary-tree
17381Insert Delete GetRandom O(1) - Duplicates allowed34.1%Hard0.041499730906752734https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed
18243Shortest Word Distance61.0%Easy0.040780370344928096https://leetcode.com/problems/shortest-word-distance
19256Paint House52.1%Easy0.03937516523483013https://leetcode.com/problems/paint-house
20261Graph Valid Tree42.2%Medium0.03683657735649026https://leetcode.com/problems/graph-valid-tree
211042Flower Planting With No Adjacent48.5%Easy0.03287066683451475https://leetcode.com/problems/flower-planting-with-no-adjacent
22150Evaluate Reverse Polish Notation36.3%Medium0.031526253646773944https://leetcode.com/problems/evaluate-reverse-polish-notation
23373Find K Pairs with Smallest Sums36.7%Medium0.02626546261018635https://leetcode.com/problems/find-k-pairs-with-smallest-sums
24127Word Ladder29.6%Medium0.023704813655166343https://leetcode.com/problems/word-ladder
25721Accounts Merge48.8%Medium0.01888630262874805https://leetcode.com/problems/accounts-merge
2634Find First and Last Position of Element in Sorted Array36.2%Medium0.01688338088311469https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
27102Binary Tree Level Order Traversal54.6%Medium0.014477270588287548https://leetcode.com/problems/binary-tree-level-order-traversal
2875Sort Colors47.3%Medium0.011198325310029539https://leetcode.com/problems/sort-colors
29739Daily Temperatures63.3%Medium0.010032690121814417https://leetcode.com/problems/daily-temperatures
3053Maximum Subarray46.5%Easy0.008640295679602939https://leetcode.com/problems/maximum-subarray
3156Merge Intervals39.3%Medium0.007796972706004796https://leetcode.com/problems/merge-intervals
32349Intersection of Two Arrays62.5%Easy0.00725034896230682https://leetcode.com/problems/intersection-of-two-arrays
33152Maximum Product Subarray31.7%Medium0.005590510716885066https://leetcode.com/problems/maximum-product-subarray
34146LRU Cache33.2%Medium0.004600353139061353https://leetcode.com/problems/lru-cache
3546Permutations63.5%Medium0.004216302230139218https://leetcode.com/problems/permutations
3633Search in Rotated Sorted Array34.5%Medium0.003229976968332634https://leetcode.com/problems/search-in-rotated-sorted-array
3720Valid Parentheses39.0%Easy0.0023005704055949323https://leetcode.com/problems/valid-parentheses
38103Binary Tree Zigzag Level Order Traversal48.3%Medium0.0017084529846397953https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
3950Pow(x;n)30.3%Medium0.0014016892647828818https://leetcode.com/problems/powx-n