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

13 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2545Boundary of Binary Tree38.9%Medium0.23484882359918047https://leetcode.com/problems/boundary-of-binary-tree
3146LRU Cache33.2%Medium0.19793208872567258https://leetcode.com/problems/lru-cache
4498Diagonal Traverse48.2%Medium0.1610153538521647https://leetcode.com/problems/diagonal-traverse
5702Search in a Sorted Array of Unknown Size66.9%Medium0.13783247452391326https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size
6968Binary Tree Cameras37.5%Hard0.12586422089000404https://leetcode.com/problems/binary-tree-cameras
7358Rearrange String k Distance Apart34.9%Hard0.08894748601649616https://leetcode.com/problems/rearrange-string-k-distance-apart
8703Kth Largest Element in a Stream49.7%Easy0.08385735299772534https://leetcode.com/problems/kth-largest-element-in-a-stream
9962Maximum Width Ramp45.4%Medium0.08184524810424337https://leetcode.com/problems/maximum-width-ramp
10250Count Univalue Subtrees52.0%Medium0.07975881838845024https://leetcode.com/problems/count-univalue-subtrees
11244Shortest Word Distance II52.3%Medium0.07622736538788424https://leetcode.com/problems/shortest-word-distance-ii
12253Meeting Rooms II45.7%Medium0.07046545668000562https://leetcode.com/problems/meeting-rooms-ii
13199Binary Tree Right Side View54.1%Medium0.06748154336946242https://leetcode.com/problems/binary-tree-right-side-view
14846Hand of Straights54.2%Medium0.06472423940349638https://leetcode.com/problems/hand-of-straights
1533Search in Rotated Sorted Array34.5%Medium0.06345616594863132https://leetcode.com/problems/search-in-rotated-sorted-array
16428Serialize and Deserialize N-ary Tree59.4%Hard0.06136894637629212https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree
17796Rotate String49.6%Easy0.059778751425839334https://leetcode.com/problems/rotate-string
18366Find Leaves of Binary Tree70.6%Medium0.05526267867504946https://leetcode.com/problems/find-leaves-of-binary-tree
19735Asteroid Collision41.0%Medium0.05479154882968245https://leetcode.com/problems/asteroid-collision
20449Serialize and Deserialize BST52.0%Medium0.049844204077291364https://leetcode.com/problems/serialize-and-deserialize-bst
21227Basic Calculator II36.9%Medium0.04870104158125306https://leetcode.com/problems/basic-calculator-ii
22143Reorder List37.1%Medium0.04554002588608351https://leetcode.com/problems/reorder-list
23341Flatten Nested List Iterator52.9%Medium0.04440788848944038https://leetcode.com/problems/flatten-nested-list-iterator
2454Spiral Matrix34.1%Medium0.040517614757835795https://leetcode.com/problems/spiral-matrix
25138Copy List with Random Pointer36.4%Medium0.03807953223592622https://leetcode.com/problems/copy-list-with-random-pointer
26560Subarray Sum Equals K43.9%Medium0.037871360699521406https://leetcode.com/problems/subarray-sum-equals-k
2751N-Queens46.6%Hard0.03651521297509749https://leetcode.com/problems/n-queens
2823Merge k Sorted Lists40.2%Hard0.035885441255624394https://leetcode.com/problems/merge-k-sorted-lists
29283Move Zeroes57.8%Easy0.03478488123548069https://leetcode.com/problems/move-zeroes
301146Snapshot Array37.0%Medium0.0317991816929387https://leetcode.com/problems/snapshot-array
31284Peeking Iterator45.7%Medium0.03110670713225487https://leetcode.com/problems/peeking-iterator
32297Serialize and Deserialize Binary Tree47.5%Hard0.028013036227673965https://leetcode.com/problems/serialize-and-deserialize-binary-tree
335Longest Palindromic Substring29.5%Medium0.02757010450426751https://leetcode.com/problems/longest-palindromic-substring
341438Longest 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
35130Surrounded Regions28.1%Medium0.02672368055211276https://leetcode.com/problems/surrounded-regions
3646Permutations63.5%Medium0.026064861710547768https://leetcode.com/problems/permutations
37200Number of Islands46.8%Medium0.025712029212602353https://leetcode.com/problems/number-of-islands
38951Flip Equivalent Binary Trees65.8%Medium0.025269822188076344https://leetcode.com/problems/flip-equivalent-binary-trees
39238Product of Array Except Self60.1%Medium0.024315533698358247https://leetcode.com/problems/product-of-array-except-self
40215Kth Largest Element in an Array55.4%Medium0.02414409892936099https://leetcode.com/problems/kth-largest-element-in-an-array
4131Next Permutation32.6%Medium0.023747034562878154https://leetcode.com/problems/next-permutation
4240Combination Sum II48.2%Medium0.021424290044083395https://leetcode.com/problems/combination-sum-ii
43698Partition to K Equal Sum Subsets45.0%Medium0.02109782896463587https://leetcode.com/problems/partition-to-k-equal-sum-subsets
44206Reverse Linked List62.5%Easy0.02086427467076072https://leetcode.com/problems/reverse-linked-list
451122Relative Sort Array67.7%Easy0.019685675071030327https://leetcode.com/problems/relative-sort-array
46173Binary Search Tree Iterator56.6%Medium0.01899993824490396https://leetcode.com/problems/binary-search-tree-iterator
473Longest Substring Without Repeating Characters30.4%Medium0.018891763947827014https://leetcode.com/problems/longest-substring-without-repeating-characters
48787Cheapest Flights Within K Stops39.3%Medium0.018824085245635554https://leetcode.com/problems/cheapest-flights-within-k-stops
49394Decode String50.0%Medium0.0182820448374491https://leetcode.com/problems/decode-string
5017Letter Combinations of a Phone Number46.8%Medium0.017492519932499718https://leetcode.com/problems/letter-combinations-of-a-phone-number
51240Search a 2D Matrix II43.2%Medium0.0169815401480941https://leetcode.com/problems/search-a-2d-matrix-ii
52658Find K Closest Elements40.9%Medium0.016611677666896175https://leetcode.com/problems/find-k-closest-elements
5310Regular Expression Matching26.8%Hard0.01609764684284749https://leetcode.com/problems/regular-expression-matching
54125Valid Palindrome36.7%Easy0.01582781088607703https://leetcode.com/problems/valid-palindrome
55977Squares of a Sorted Array72.1%Easy0.015474196582597383https://leetcode.com/problems/squares-of-a-sorted-array
56103Binary Tree Zigzag Level Order Traversal48.3%Medium0.015272005981326173https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
57153Find Minimum in Rotated Sorted Array45.1%Medium0.014939586916186732https://leetcode.com/problems/find-minimum-in-rotated-sorted-array
58102Binary Tree Level Order Traversal54.6%Medium0.014477270588287548https://leetcode.com/problems/binary-tree-level-order-traversal
5920Valid Parentheses39.0%Easy0.014292491180025941https://leetcode.com/problems/valid-parentheses
60443String Compression41.3%Easy0.01390843004613198https://leetcode.com/problems/string-compression
61141Linked List Cycle41.1%Easy0.01390238743679306https://leetcode.com/problems/linked-list-cycle
6256Merge Intervals39.3%Medium0.013819532422258866https://leetcode.com/problems/merge-intervals
63767Reorganize String48.7%Medium0.01329806830463147https://leetcode.com/problems/reorganize-string
64665Non-decreasing Array19.5%Easy0.013016779950191773https://leetcode.com/problems/non-decreasing-array
65129Sum Root to Leaf Numbers49.1%Medium0.012739025777429757https://leetcode.com/problems/sum-root-to-leaf-numbers
66213House Robber II36.5%Medium0.012654392210497564https://leetcode.com/problems/house-robber-ii
67287Find the Duplicate Number55.5%Medium0.012335682739188652https://leetcode.com/problems/find-the-duplicate-number
68445Add Two Numbers II54.5%Medium0.01233061245747872https://leetcode.com/problems/add-two-numbers-ii
69547Friend Circles58.6%Medium0.012228828639434596https://leetcode.com/problems/friend-circles
70300Longest Increasing Subsequence42.6%Medium0.011806512586989004https://leetcode.com/problems/longest-increasing-subsequence
71785Is Graph Bipartite?47.5%Medium0.011236073266925854https://leetcode.com/problems/is-graph-bipartite
72207Course Schedule43.1%Medium0.01113459480911671https://leetcode.com/problems/course-schedule
73160Intersection of Two Linked Lists40.6%Easy0.010994491398666248https://leetcode.com/problems/intersection-of-two-linked-lists
74662Maximum Width of Binary Tree41.0%Medium0.010790501245113902https://leetcode.com/problems/maximum-width-of-binary-tree
75236Lowest Common Ancestor of a Binary Tree45.7%Medium0.010575891759058162https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
76211Add and Search Word - Data structure design38.1%Medium0.010438508143923443https://leetcode.com/problems/add-and-search-word-data-structure-design
7725Reverse Nodes in k-Group42.1%Hard0.01021198560502829https://leetcode.com/problems/reverse-nodes-in-k-group
781Two Sum45.6%Easy0.010006414028595919https://leetcode.com/problems/two-sum
79279Perfect Squares47.4%Medium0.009216655104924008https://leetcode.com/problems/perfect-squares
8032Longest Valid Parentheses28.4%Hard0.009111680351255843https://leetcode.com/problems/longest-valid-parentheses
81208Implement Trie (Prefix Tree)49.4%Medium0.009105457856626612https://leetcode.com/problems/implement-trie-prefix-tree
82189Rotate Array34.7%Easy0.00904437880665999https://leetcode.com/problems/rotate-array
83295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
8428Implement strStr()34.5%Easy0.008850485542574548https://leetcode.com/problems/implement-strstr
854Median of Two Sorted Arrays29.6%Hard0.008754068159914991https://leetcode.com/problems/median-of-two-sorted-arrays
86139Word Break40.1%Medium0.008741314401573542https://leetcode.com/problems/word-break
8753Maximum Subarray46.5%Easy0.008640295679602939https://leetcode.com/problems/maximum-subarray
8849Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
898String to Integer (atoi)15.4%Medium0.008513104762248265https://leetcode.com/problems/string-to-integer-atoi
90328Odd Even Linked List55.7%Medium0.00764383618585562https://leetcode.com/problems/odd-even-linked-list
91994Rotting Oranges49.2%Medium0.007630712341163886https://leetcode.com/problems/rotting-oranges
92176Second Highest Salary31.6%Easy0.007393749024938284https://leetcode.com/problems/second-highest-salary
93344Reverse String68.5%Easy0.00734157796234515https://leetcode.com/problems/reverse-string
9466Plus One43.0%Easy0.007324847595025828https://leetcode.com/problems/plus-one
95204Count Primes31.5%Easy0.007072165261362441https://leetcode.com/problems/count-primes
96142Linked List Cycle II37.3%Medium0.006564934131150057https://leetcode.com/problems/linked-list-cycle-ii
9741First Missing Positive32.0%Hard0.0064113058208121855https://leetcode.com/problems/first-missing-positive
9883Remove Duplicates from Sorted List45.4%Easy0.006353261522609498https://leetcode.com/problems/remove-duplicates-from-sorted-list
99202Happy Number50.4%Easy0.006266666286010046https://leetcode.com/problems/happy-number
10076Minimum Window Substring34.6%Hard0.006231520398723243https://leetcode.com/problems/minimum-window-substring
10124Swap Nodes in Pairs50.4%Medium0.0062218275061505365https://leetcode.com/problems/swap-nodes-in-pairs
102347Top K Frequent Elements61.2%Medium0.005929457040438874https://leetcode.com/problems/top-k-frequent-elements
103973K Closest Points to Origin63.8%Medium0.005773688094426333https://leetcode.com/problems/k-closest-points-to-origin
10439Combination Sum56.1%Medium0.005715934396440999https://leetcode.com/problems/combination-sum
10521Merge Two Sorted Lists53.5%Easy0.005067007800877041https://leetcode.com/problems/merge-two-sorted-lists
10675Sort Colors47.3%Medium0.004992521603120986https://leetcode.com/problems/sort-colors
107153Sum26.8%Medium0.004940992758742591https://leetcode.com/problems/3sum
108155Min Stack44.5%Easy0.00474891074128171https://leetcode.com/problems/min-stack
10942Trapping Rain Water48.9%Hard0.004350670338744988https://leetcode.com/problems/trapping-rain-water
110322Coin Change35.5%Medium0.004029826126500844https://leetcode.com/problems/coin-change
111198House Robber42.0%Easy0.0037576371128333645https://leetcode.com/problems/house-robber
11278Subsets62.0%Medium0.00368765975195334https://leetcode.com/problems/subsets
11314Longest Common Prefix35.4%Easy0.003320331762984143https://leetcode.com/problems/longest-common-prefix
11450Pow(x;n)30.3%Medium0.0031510424503886844https://leetcode.com/problems/powx-n
11588Merge Sorted Array39.4%Easy0.0030102370714243072https://leetcode.com/problems/merge-sorted-array
11698Validate Binary Search Tree27.8%Medium0.002943776044013381https://leetcode.com/problems/validate-binary-search-tree
117140Word Break II32.6%Hard0.0027070942357783584https://leetcode.com/problems/word-break-ii
11826Remove Duplicates from Sorted Array45.1%Easy0.0019513153174351963https://leetcode.com/problems/remove-duplicates-from-sorted-array
1192Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers