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

5.6 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2735Asteroid Collision41.0%Medium2.8217088979664124https://leetcode.com/problems/asteroid-collision
3716Max Stack42.6%Easy2.0561349637374544https://leetcode.com/problems/max-stack
4238Product of Array Except Self60.1%Medium1.9880213444075543https://leetcode.com/problems/product-of-array-except-self
5158Read N Characters Given Read4 II - Call multiple times33.8%Hard1.2224474101785963https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times
6981Time Based Key-Value Store53.1%Medium1.1090620945258824https://leetcode.com/problems/time-based-key-value-store
7642Design Search Autocomplete System44.7%Hard0.9534648850908103https://leetcode.com/problems/design-search-autocomplete-system
8365Water and Jug Problem30.6%Medium0.8801037398580485https://leetcode.com/problems/water-and-jug-problem
9127Word Ladder29.6%Medium0.4325804000994867https://leetcode.com/problems/word-ladder
1042Trapping Rain Water48.9%Hard0.36187179404352093https://leetcode.com/problems/trapping-rain-water
11200Number of Islands46.8%Medium0.3002278451426276https://leetcode.com/problems/number-of-islands
12349Intersection of Two Arrays62.5%Easy0.23266691552464092https://leetcode.com/problems/intersection-of-two-arrays
13251Flatten 2D Vector45.7%Medium0.14355814329423544https://leetcode.com/problems/flatten-2d-vector
14426Convert Binary Search Tree to Sorted Doubly Linked List59.1%Medium0.14252878462127264https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list
15279Perfect Squares47.4%Medium0.13815033848081718https://leetcode.com/problems/perfect-squares
16333Largest BST Subtree35.8%Medium0.13138400282910845https://leetcode.com/problems/largest-bst-subtree
17304Range Sum Query 2D - Immutable38.6%Medium0.11875551458160917https://leetcode.com/problems/range-sum-query-2d-immutable
18652Find Duplicate Subtrees50.2%Medium0.08907963005368878https://leetcode.com/problems/find-duplicate-subtrees
19109Convert Sorted List to Binary Search Tree47.7%Medium0.08701137698962977https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree
2076Minimum Window Substring34.6%Hard0.07378420845373558https://leetcode.com/problems/minimum-window-substring
2191Decode Ways24.7%Medium0.07076721180832166https://leetcode.com/problems/decode-ways
2268Text Justification27.7%Hard0.06116036187169583https://leetcode.com/problems/text-justification
2310Regular Expression Matching26.8%Hard0.04409107726484965https://leetcode.com/problems/regular-expression-matching
2422Generate Parentheses62.7%Medium0.038581724751038625https://leetcode.com/problems/generate-parentheses
25694Number of Distinct Islands56.0%Medium0.03278982282299087https://leetcode.com/problems/number-of-distinct-islands
2617Letter Combinations of a Phone Number46.8%Medium0.027199239804368825https://leetcode.com/problems/letter-combinations-of-a-phone-number
27442Find All Duplicates in an Array67.8%Medium0.02608087555279249https://leetcode.com/problems/find-all-duplicates-in-an-array
2823Merge k Sorted Lists40.2%Hard0.0250564321052577https://leetcode.com/problems/merge-k-sorted-lists
2920Valid Parentheses39.0%Easy0.020517047266669974https://leetcode.com/problems/valid-parentheses
3048Rotate Image56.7%Medium0.020228249775471566https://leetcode.com/problems/rotate-image
31341Flatten Nested List Iterator52.9%Medium0.019980684690483426https://leetcode.com/problems/flatten-nested-list-iterator
32146LRU Cache33.2%Medium0.01827577993873683https://leetcode.com/problems/lru-cache
33253Meeting Rooms II45.7%Medium0.018087309810579388https://leetcode.com/problems/meeting-rooms-ii
34126Word Ladder II22.1%Hard0.017994187717865196https://leetcode.com/problems/word-ladder-ii
35239Sliding Window Maximum43.0%Hard0.01768566434627554https://leetcode.com/problems/sliding-window-maximum
361060Missing Element in Sorted Array54.5%Medium0.017429635135283658https://leetcode.com/problems/missing-element-in-sorted-array
377Reverse Integer25.8%Easy0.016627790608488954https://leetcode.com/problems/reverse-integer
38567Permutation in String44.4%Medium0.014947961435873182https://leetcode.com/problems/permutation-in-string
39162Find Peak Element43.3%Medium0.014231739257256364https://leetcode.com/problems/find-peak-element
4088Merge Sorted Array39.4%Easy0.011986958032982505https://leetcode.com/problems/merge-sorted-array
4169Sqrt(x)33.9%Easy0.011443227222342794https://leetcode.com/problems/sqrtx
4278Subsets62.0%Medium0.008278192969371254https://leetcode.com/problems/subsets
4311Container With Most Water50.8%Medium0.006889188300412141https://leetcode.com/problems/container-with-most-water
4424Swap Nodes in Pairs50.4%Medium0.0062218275061505365https://leetcode.com/problems/swap-nodes-in-pairs
45155Min Stack44.5%Easy0.00474891074128171https://leetcode.com/problems/min-stack
46283Move Zeroes57.8%Easy0.0028853803470673955https://leetcode.com/problems/move-zeroes
4721Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
48121Best Time to Buy and Sell Stock50.5%Easy0.0021239321954525975https://leetcode.com/problems/best-time-to-buy-and-sell-stock
492Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers
5079Word Search35.6%Medium0.0016647248725526849https://leetcode.com/problems/word-search
511Two Sum45.6%Easy0.0008206138651873125https://leetcode.com/problems/two-sum