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

8.6 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2545Boundary of Binary Tree38.9%Medium0.09349966258159505https://leetcode.com/problems/boundary-of-binary-tree
3250Count Univalue Subtrees52.0%Medium0.07975881838845024https://leetcode.com/problems/count-univalue-subtrees
4244Shortest Word Distance II52.3%Medium0.07622736538788424https://leetcode.com/problems/shortest-word-distance-ii
5146LRU Cache33.2%Medium0.07118067822062889https://leetcode.com/problems/lru-cache
6846Hand of Straights54.2%Medium0.06472423940349638https://leetcode.com/problems/hand-of-straights
7968Binary Tree Cameras37.5%Hard0.05790329283155908https://leetcode.com/problems/binary-tree-cameras
8253Meeting Rooms II45.7%Medium0.04945628059066218https://leetcode.com/problems/meeting-rooms-ii
9143Reorder List37.1%Medium0.04554002588608351https://leetcode.com/problems/reorder-list
101146Snapshot Array37.0%Medium0.0317991816929387https://leetcode.com/problems/snapshot-array
11284Peeking Iterator45.7%Medium0.03110670713225487https://leetcode.com/problems/peeking-iterator
12227Basic Calculator II36.9%Medium0.027685557859864054https://leetcode.com/problems/basic-calculator-ii
13498Diagonal Traverse48.2%Medium0.02756894104498661https://leetcode.com/problems/diagonal-traverse
141438Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit42.1%Medium0.026955809988528263https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit
15130Surrounded Regions28.1%Medium0.02672368055211276https://leetcode.com/problems/surrounded-regions
16951Flip Equivalent Binary Trees65.8%Medium0.025269822188076344https://leetcode.com/problems/flip-equivalent-binary-trees
1740Combination Sum II48.2%Medium0.021424290044083395https://leetcode.com/problems/combination-sum-ii
18341Flatten Nested List Iterator52.9%Medium0.019980684690483426https://leetcode.com/problems/flatten-nested-list-iterator
19787Cheapest Flights Within K Stops39.3%Medium0.018824085245635554https://leetcode.com/problems/cheapest-flights-within-k-stops
20283Move Zeroes57.8%Easy0.01789853050377608https://leetcode.com/problems/move-zeroes
21240Search a 2D Matrix II43.2%Medium0.0169815401480941https://leetcode.com/problems/search-a-2d-matrix-ii
22658Find K Closest Elements40.9%Medium0.016611677666896175https://leetcode.com/problems/find-k-closest-elements
2351N-Queens46.6%Hard0.016393809775676407https://leetcode.com/problems/n-queens
24297Serialize and Deserialize Binary Tree47.5%Hard0.01585377577217724https://leetcode.com/problems/serialize-and-deserialize-binary-tree
25215Kth Largest Element in an Array55.4%Medium0.015519225147600912https://leetcode.com/problems/kth-largest-element-in-an-array
26153Find Minimum in Rotated Sorted Array45.1%Medium0.014939586916186732https://leetcode.com/problems/find-minimum-in-rotated-sorted-array
27443String Compression41.3%Easy0.01390843004613198https://leetcode.com/problems/string-compression
28703Kth Largest Element in a Stream49.7%Easy0.013898764390814973https://leetcode.com/problems/kth-largest-element-in-a-stream
29138Copy List with Random Pointer36.4%Medium0.013876263355766411https://leetcode.com/problems/copy-list-with-random-pointer
30767Reorganize String48.7%Medium0.01329806830463147https://leetcode.com/problems/reorganize-string
31665Non-decreasing Array19.5%Easy0.013016779950191773https://leetcode.com/problems/non-decreasing-array
3233Search in Rotated Sorted Array34.5%Medium0.012857779194289386https://leetcode.com/problems/search-in-rotated-sorted-array
33129Sum Root to Leaf Numbers49.1%Medium0.012739025777429757https://leetcode.com/problems/sum-root-to-leaf-numbers
34213House Robber II36.5%Medium0.012654392210497564https://leetcode.com/problems/house-robber-ii
35445Add Two Numbers II54.5%Medium0.01233061245747872https://leetcode.com/problems/add-two-numbers-ii
36547Friend Circles58.6%Medium0.012228828639434596https://leetcode.com/problems/friend-circles
37300Longest Increasing Subsequence42.6%Medium0.011806512586989004https://leetcode.com/problems/longest-increasing-subsequence
38200Number of Islands46.8%Medium0.011509262420590827https://leetcode.com/problems/number-of-islands
39785Is Graph Bipartite?47.5%Medium0.011236073266925854https://leetcode.com/problems/is-graph-bipartite
40160Intersection of Two Linked Lists40.6%Easy0.010994491398666248https://leetcode.com/problems/intersection-of-two-linked-lists
41662Maximum Width of Binary Tree41.0%Medium0.010790501245113902https://leetcode.com/problems/maximum-width-of-binary-tree
4217Letter Combinations of a Phone Number46.8%Medium0.00987716546167603https://leetcode.com/problems/letter-combinations-of-a-phone-number
433Longest Substring Without Repeating Characters30.4%Medium0.009683242444739549https://leetcode.com/problems/longest-substring-without-repeating-characters
44560Subarray Sum Equals K43.9%Medium0.009603146783199741https://leetcode.com/problems/subarray-sum-equals-k
4546Permutations63.5%Medium0.009461803137288448https://leetcode.com/problems/permutations
4623Merge k Sorted Lists40.2%Hard0.009092808657599025https://leetcode.com/problems/merge-k-sorted-lists
475Longest Palindromic Substring29.5%Medium0.009086325220960808https://leetcode.com/problems/longest-palindromic-substring
48977Squares of a Sorted Array72.1%Easy0.008733679968754604https://leetcode.com/problems/squares-of-a-sorted-array
49394Decode String50.0%Medium0.008166644000272283https://leetcode.com/problems/decode-string
5056Merge Intervals39.3%Medium0.007796972706004796https://leetcode.com/problems/merge-intervals
51994Rotting Oranges49.2%Medium0.007630712341163886https://leetcode.com/problems/rotting-oranges
521Two Sum45.6%Easy0.0073613942765888805https://leetcode.com/problems/two-sum
5341First Missing Positive32.0%Hard0.0064113058208121855https://leetcode.com/problems/first-missing-positive
5483Remove Duplicates from Sorted List45.4%Easy0.006353261522609498https://leetcode.com/problems/remove-duplicates-from-sorted-list
55202Happy Number50.4%Easy0.006266666286010046https://leetcode.com/problems/happy-number
5676Minimum Window Substring34.6%Hard0.006231520398723243https://leetcode.com/problems/minimum-window-substring
5731Next Permutation32.6%Medium0.005989835219179644https://leetcode.com/problems/next-permutation
5839Combination Sum56.1%Medium0.005715934396440999https://leetcode.com/problems/combination-sum
59199Binary Tree Right Side View54.1%Medium0.0056826406650506926https://leetcode.com/problems/binary-tree-right-side-view
60206Reverse Linked List62.5%Easy0.005257021452801617https://leetcode.com/problems/reverse-linked-list
6120Valid Parentheses39.0%Easy0.005168860577665306https://leetcode.com/problems/valid-parentheses
6242Trapping Rain Water48.9%Hard0.004350670338744988https://leetcode.com/problems/trapping-rain-water
63322Coin Change35.5%Medium0.004029826126500844https://leetcode.com/problems/coin-change
64189Rotate Array34.7%Easy0.004029826126500844https://leetcode.com/problems/rotate-array
65238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
66139Word Break40.1%Medium0.003894465052690167https://leetcode.com/problems/word-break
67103Binary Tree Zigzag Level Order Traversal48.3%Medium0.003839922800048048https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
688String to Integer (atoi)15.4%Medium0.0037925521897059712https://leetcode.com/problems/string-to-integer-atoi
69198House Robber42.0%Easy0.0037576371128333645https://leetcode.com/problems/house-robber
70102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
71141Linked List Cycle41.1%Easy0.0034937584669245472https://leetcode.com/problems/linked-list-cycle
72347Top K Frequent Elements61.2%Medium0.0033396446491217604https://leetcode.com/problems/top-k-frequent-elements
7314Longest Common Prefix35.4%Easy0.003320331762984143https://leetcode.com/problems/longest-common-prefix
7466Plus One43.0%Easy0.00326211347832938https://leetcode.com/problems/plus-one
7598Validate Binary Search Tree27.8%Medium0.002943776044013381https://leetcode.com/problems/validate-binary-search-tree
7621Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
77153Sum26.8%Medium0.0021990113314367685https://leetcode.com/problems/3sum
7850Pow(x;n)30.3%Medium0.0014016892647828818https://leetcode.com/problems/powx-n