Files
LeetCode-Questions-CompanyWise/lyft_alltime.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.9 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2735Asteroid Collision41.0%Medium3.4954470610602737https://leetcode.com/problems/asteroid-collision
3238Product of Array Except Self60.1%Medium2.8845625241577855https://leetcode.com/problems/product-of-array-except-self
4716Max Stack42.6%Easy2.664361506099879https://leetcode.com/problems/max-stack
5158Read N Characters Given Read4 II - Call multiple times33.8%Hard2.0534769691973906https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times
6642Design Search Autocomplete System44.7%Hard1.7721893730339577https://leetcode.com/problems/design-search-autocomplete-system
7981Time Based Key-Value Store53.1%Medium1.4448976756888186https://leetcode.com/problems/time-based-key-value-store
8365Water and Jug Problem30.6%Medium1.372259043003507https://leetcode.com/problems/water-and-jug-problem
9200Number of Islands46.8%Medium1.3061913612704517https://leetcode.com/problems/number-of-islands
1042Trapping Rain Water48.9%Hard1.1347229625176425https://leetcode.com/problems/trapping-rain-water
11127Word Ladder29.6%Medium0.5839478885949534https://leetcode.com/problems/word-ladder
12349Intersection of Two Arrays62.5%Easy0.5467734703822922https://leetcode.com/problems/intersection-of-two-arrays
1368Text Justification27.7%Hard0.4495613440132932https://leetcode.com/problems/text-justification
14126Word Ladder II22.1%Hard0.37426780280681504https://leetcode.com/problems/word-ladder-ii
15426Convert Binary Search Tree to Sorted Doubly Linked List59.1%Medium0.3308542443169896https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list
1691Decode Ways24.7%Medium0.32434096851350985https://leetcode.com/problems/decode-ways
17146LRU Cache33.2%Medium0.2585885798043696https://leetcode.com/problems/lru-cache
18279Perfect Squares47.4%Medium0.24693241327822452https://leetcode.com/problems/perfect-squares
19251Flatten 2D Vector45.7%Medium0.2425088583672668https://leetcode.com/problems/flatten-2d-vector
2017Letter Combinations of a Phone Number46.8%Medium0.22166457131988548https://leetcode.com/problems/letter-combinations-of-a-phone-number
21304Range Sum Query 2D - Immutable38.6%Medium0.20226153257780005https://leetcode.com/problems/range-sum-query-2d-immutable
22155Min Stack44.5%Easy0.15817175770099312https://leetcode.com/problems/min-stack
23652Find Duplicate Subtrees50.2%Medium0.1532629744871177https://leetcode.com/problems/find-duplicate-subtrees
2476Minimum Window Substring34.6%Hard0.14520312778609068https://leetcode.com/problems/minimum-window-substring
25333Largest BST Subtree35.8%Medium0.13138400282910845https://leetcode.com/problems/largest-bst-subtree
26109Convert Sorted List to Binary Search Tree47.7%Medium0.12302181451266285https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree
27341Flatten Nested List Iterator52.9%Medium0.11879160861126825https://leetcode.com/problems/flatten-nested-list-iterator
2810Regular Expression Matching26.8%Hard0.10921172706929158https://leetcode.com/problems/regular-expression-matching
2911Container With Most Water50.8%Medium0.07400372347113877https://leetcode.com/problems/container-with-most-water
30632Smallest Range Covering Elements from K Lists52.4%Hard0.07082605256861242https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists
3123Merge k Sorted Lists40.2%Hard0.06293239083543646https://leetcode.com/problems/merge-k-sorted-lists
3222Generate Parentheses62.7%Medium0.05215612134598845https://leetcode.com/problems/generate-parentheses
3378Subsets62.0%Medium0.044263005655043326https://leetcode.com/problems/subsets
34121Best Time to Buy and Sell Stock50.5%Easy0.04215422741819192https://leetcode.com/problems/best-time-to-buy-and-sell-stock
351094Car Pooling56.7%Medium0.04016604172533471https://leetcode.com/problems/car-pooling
3620Valid Parentheses39.0%Easy0.03618871742239114https://leetcode.com/problems/valid-parentheses
3779Word Search35.6%Medium0.03318208821436187https://leetcode.com/problems/word-search
38694Number of Distinct Islands56.0%Medium0.03278982282299087https://leetcode.com/problems/number-of-distinct-islands
39253Meeting Rooms II45.7%Medium0.03193246767820989https://leetcode.com/problems/meeting-rooms-ii
4069Sqrt(x)33.9%Easy0.03146892772463772https://leetcode.com/problems/sqrtx
4148Rotate Image56.7%Medium0.03142936253029228https://leetcode.com/problems/rotate-image
427Reverse Integer25.8%Easy0.029372034825448746https://leetcode.com/problems/reverse-integer
4388Merge Sorted Array39.4%Easy0.02677137871391415https://leetcode.com/problems/merge-sorted-array
44442Find All Duplicates in an Array67.8%Medium0.02608087555279249https://leetcode.com/problems/find-all-duplicates-in-an-array
45162Find Peak Element43.3%Medium0.02516251642407408https://leetcode.com/problems/find-peak-element
461Two Sum45.6%Easy0.024530411623017775https://leetcode.com/problems/two-sum
47283Move Zeroes57.8%Easy0.01789853050377608https://leetcode.com/problems/move-zeroes
48239Sliding Window Maximum43.0%Hard0.01768566434627554https://leetcode.com/problems/sliding-window-maximum
491060Missing Element in Sorted Array54.5%Medium0.017429635135283658https://leetcode.com/problems/missing-element-in-sorted-array
50567Permutation in String44.4%Medium0.014947961435873182https://leetcode.com/problems/permutation-in-string
5124Swap Nodes in Pairs50.4%Medium0.013945066390122038https://leetcode.com/problems/swap-nodes-in-pairs
522Add Two Numbers33.9%Medium0.010507388732168088https://leetcode.com/problems/add-two-numbers
5321Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
54443String Compression41.3%Easy0https://leetcode.com/problems/string-compression