LeetCode-Questions-CompanyWise/bytedance_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
2407Trapping Rain Water II42.4%Hard0.4558904036597034https://leetcode.com/problems/trapping-rain-water-ii
3403Frog Jump39.7%Hard0.4111319463019136https://leetcode.com/problems/frog-jump
425Reverse Nodes in k-Group42.1%Hard0.35618539084316814https://leetcode.com/problems/reverse-nodes-in-k-group
5440K-th Smallest in Lexicographical Order29.1%Hard0.34839058652267263https://leetcode.com/problems/k-th-smallest-in-lexicographical-order
61202Smallest String With Swaps46.5%Medium0.3389771958902773https://leetcode.com/problems/smallest-string-with-swaps
7493Reverse Pairs25.2%Hard0.32990170311860656https://leetcode.com/problems/reverse-pairs
8465Optimal Account Balancing46.9%Hard0.3042973734047784https://leetcode.com/problems/optimal-account-balancing
942Trapping Rain Water48.9%Hard0.2984014185392094https://leetcode.com/problems/trapping-rain-water
10777Swap Adjacent in LR String34.8%Medium0.2968864859764594https://leetcode.com/problems/swap-adjacent-in-lr-string
11146LRU Cache33.2%Medium0.28348791657320827https://leetcode.com/problems/lru-cache
121262Greatest Sum Divisible by Three47.6%Medium0.22854136111446283https://leetcode.com/problems/greatest-sum-divisible-by-three
13670Maximum Swap43.6%Medium0.1735948056557174https://leetcode.com/problems/maximum-swap
14351Android Unlock Patterns48.4%Medium0.15521621002929656https://leetcode.com/problems/android-unlock-patterns
15470Implement Rand10() Using Rand7()46.3%Medium0.15154989812720093https://leetcode.com/problems/implement-rand10-using-rand7
16317Shortest Distance from All Buildings41.4%Hard0.14387423888417297https://leetcode.com/problems/shortest-distance-from-all-buildings
17726Number of Atoms49.0%Hard0.13804422079620546https://leetcode.com/problems/number-of-atoms
181172Dinner Plate Stacks38.2%Hard0.12963106265293975https://leetcode.com/problems/dinner-plate-stacks
19316Remove Duplicate Letters35.8%Hard0.1165801830326188https://leetcode.com/problems/remove-duplicate-letters
20329Longest Increasing Path in a Matrix43.4%Hard0.11459264165812869https://leetcode.com/problems/longest-increasing-path-in-a-matrix
21681Next Closest Time45.0%Medium0.11013564249600598https://leetcode.com/problems/next-closest-time
22143Reorder List37.1%Medium0.09969510903753867https://leetcode.com/problems/reorder-list
23320Generalized Abbreviation52.1%Medium0.09352605801082346https://leetcode.com/problems/generalized-abbreviation
2431Next Permutation32.6%Medium0.09178119886142269https://leetcode.com/problems/next-permutation
2533Search in Rotated Sorted Array34.5%Medium0.07777550022464022https://leetcode.com/problems/search-in-rotated-sorted-array
261057Campus Bikes57.7%Medium0.07107786641655695https://leetcode.com/problems/campus-bikes
27386Lexicographical Numbers51.6%Medium0.06875559541512997https://leetcode.com/problems/lexicographical-numbers
28199Binary Tree Right Side View54.1%Medium0.06748154336946242https://leetcode.com/problems/binary-tree-right-side-view
2951N-Queens46.6%Hard0.06402185876493102https://leetcode.com/problems/n-queens
303Longest Substring Without Repeating Characters30.4%Medium0.06370380162663494https://leetcode.com/problems/longest-substring-without-repeating-characters
31772Basic Calculator III41.3%Hard0.06331227941432688https://leetcode.com/problems/basic-calculator-iii
3223Merge k Sorted Lists40.2%Hard0.06293239083543646https://leetcode.com/problems/merge-k-sorted-lists
33236Lowest Common Ancestor of a Binary Tree45.7%Medium0.05627201992757647https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
34735Asteroid Collision41.0%Medium0.05479154882968245https://leetcode.com/problems/asteroid-collision
35395Longest Substring with At Least K Repeating Characters41.4%Medium0.05371219359052555https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters
361339Maximum Product of Splitted Binary Tree37.2%Medium0.05064373281875492https://leetcode.com/problems/maximum-product-of-splitted-binary-tree
37282Expression Add Operators35.5%Hard0.049982640867735496https://leetcode.com/problems/expression-add-operators
38449Serialize and Deserialize BST52.0%Medium0.049844204077291364https://leetcode.com/problems/serialize-and-deserialize-bst
39695Max Area of Island62.7%Medium0.04980799142417255https://leetcode.com/problems/max-area-of-island
40445Add Two Numbers II54.5%Medium0.04843561709959499https://leetcode.com/problems/add-two-numbers-ii
411283Find the Smallest Divisor Given a Threshold47.6%Medium0.047798823737776906https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
42215Kth Largest Element in an Array55.4%Medium0.04678657567912081https://leetcode.com/problems/kth-largest-element-in-an-array
43543Diameter of Binary Tree48.4%Easy0.04676784186766119https://leetcode.com/problems/diameter-of-binary-tree
44240Search a 2D Matrix II43.2%Medium0.04647676584572884https://leetcode.com/problems/search-a-2d-matrix-ii
45856Score of Parentheses60.5%Medium0.04567003683318837https://leetcode.com/problems/score-of-parentheses
461235Maximum Profit in Job Scheduling44.0%Hard0.040573516447166516https://leetcode.com/problems/maximum-profit-in-job-scheduling
4772Edit Distance44.8%Hard0.039482058697133414https://leetcode.com/problems/edit-distance
48402Remove K Digits28.4%Medium0.03755134565213245https://leetcode.com/problems/remove-k-digits
491249Minimum Remove to Make Valid Parentheses62.5%Medium0.03628515973976445https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses
5071Simplify Path32.6%Medium0.03622126343431837https://leetcode.com/problems/simplify-path
51124Binary Tree Maximum Path Sum34.3%Hard0.034081815554754834https://leetcode.com/problems/binary-tree-maximum-path-sum
52974Subarray Sums Divisible by K48.9%Medium0.03367321510658789https://leetcode.com/problems/subarray-sums-divisible-by-k
53209Minimum Size Subarray Sum38.2%Medium0.033239453928687726https://leetcode.com/problems/minimum-size-subarray-sum
54222Count Complete Tree Nodes46.8%Medium0.031263400619043376https://leetcode.com/problems/count-complete-tree-nodes
55207Course Schedule43.1%Medium0.030628389490117876https://leetcode.com/problems/course-schedule
5644Wildcard Matching24.7%Hard0.030573033362282363https://leetcode.com/problems/wildcard-matching
57160Intersection of Two Linked Lists40.6%Easy0.030246680296091687https://leetcode.com/problems/intersection-of-two-linked-lists
58415Add Strings47.5%Easy0.030009753867991852https://leetcode.com/problems/add-strings
5921Merge Two Sorted Lists53.5%Easy0.02728150490352749https://leetcode.com/problems/merge-two-sorted-lists
6079Word Search35.6%Medium0.026308653156300807https://leetcode.com/problems/word-search
6154Spiral Matrix34.1%Medium0.02611966966892215https://leetcode.com/problems/spiral-matrix
6241First Missing Positive32.0%Hard0.02540222313806603https://leetcode.com/problems/first-missing-positive
63347Top K Frequent Elements61.2%Medium0.02350975159825416https://leetcode.com/problems/top-k-frequent-elements
64286Walls and Gates54.5%Medium0.02324334737232728https://leetcode.com/problems/walls-and-gates
6578Subsets62.0%Medium0.022827872206034577https://leetcode.com/problems/subsets
66152Maximum Product Subarray31.7%Medium0.022176931045949227https://leetcode.com/problems/maximum-product-subarray
67958Check Completeness of a Binary Tree52.1%Medium0.021763644636359686https://leetcode.com/problems/check-completeness-of-a-binary-tree
68698Partition to K Equal Sum Subsets45.0%Medium0.02109782896463587https://leetcode.com/problems/partition-to-k-equal-sum-subsets
69206Reverse Linked List62.5%Easy0.02086427467076072https://leetcode.com/problems/reverse-linked-list
70350Intersection of Two Arrays II51.4%Easy0.020680587107206983https://leetcode.com/problems/intersection-of-two-arrays-ii
711Two Sum45.6%Easy0.020315992091756507https://leetcode.com/problems/two-sum
721143Longest Common Subsequence58.4%Medium0.019772173115579716https://leetcode.com/problems/longest-common-subsequence
7353Maximum Subarray46.5%Easy0.019336728821707075https://leetcode.com/problems/maximum-subarray
7411Container With Most Water50.8%Medium0.019020658639039362https://leetcode.com/problems/container-with-most-water
75173Binary Search Tree Iterator56.6%Medium0.01899993824490396https://leetcode.com/problems/binary-search-tree-iterator
76314Binary Tree Vertical Order Traversal45.3%Medium0.018010392274465332https://leetcode.com/problems/binary-tree-vertical-order-traversal
77406Queue Reconstruction by Height66.9%Medium0.01774669468133533https://leetcode.com/problems/queue-reconstruction-by-height
7822Generate Parentheses62.7%Medium0.017331456351639924https://leetcode.com/problems/generate-parentheses
79863All Nodes Distance K in Binary Tree55.4%Medium0.01695674371877865https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree
80322Coin Change35.5%Medium0.016022774188122292https://leetcode.com/problems/coin-change
81103Binary Tree Zigzag Level Order Traversal48.3%Medium0.015272005981326173https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
8276Minimum Window Substring34.6%Hard0.013966707481708198https://leetcode.com/problems/minimum-window-substring
83179Largest Number28.8%Medium0.013865040137171665https://leetcode.com/problems/largest-number
8456Merge Intervals39.3%Medium0.013819532422258866https://leetcode.com/problems/merge-intervals
85523Continuous Subarray Sum24.6%Medium0.011816976504784561https://leetcode.com/problems/continuous-subarray-sum
8655Jump Game34.6%Medium0.011265609194218986https://leetcode.com/problems/jump-game
87148Sort List42.3%Medium0.011204599012863078https://leetcode.com/problems/sort-list
8892Reverse Linked List II38.8%Medium0.010427623162259089https://leetcode.com/problems/reverse-linked-list-ii
89212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
90113Path Sum II46.7%Medium0.009784813879998279https://leetcode.com/problems/path-sum-ii
9134Find First and Last Position of Element in Sorted Array36.2%Medium0.009531951009811851https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
9246Permutations63.5%Medium0.009461803137288448https://leetcode.com/problems/permutations
93295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
944Median of Two Sorted Arrays29.6%Hard0.008754068159914991https://leetcode.com/problems/median-of-two-sorted-arrays
95139Word Break40.1%Medium0.008741314401573542https://leetcode.com/problems/word-break
96977Squares of a Sorted Array72.1%Easy0.008733679968754604https://leetcode.com/problems/squares-of-a-sorted-array
97121Best Time to Buy and Sell Stock50.5%Easy0.00846879565300311https://leetcode.com/problems/best-time-to-buy-and-sell-stock
98394Decode String50.0%Medium0.008166644000272283https://leetcode.com/problems/decode-string
99239Sliding Window Maximum43.0%Hard0.007898935224534491https://leetcode.com/problems/sliding-window-maximum
100349Intersection of Two Arrays62.5%Easy0.00725034896230682https://leetcode.com/problems/intersection-of-two-arrays
10110Regular Expression Matching26.8%Hard0.0071865203293987245https://leetcode.com/problems/regular-expression-matching
102110Balanced Binary Tree43.5%Easy0.007027435807456887https://leetcode.com/problems/balanced-binary-tree
10319Remove Nth Node From End of List35.2%Medium0.0069087555063702365https://leetcode.com/problems/remove-nth-node-from-end-of-list
104114Flatten Binary Tree to Linked List49.3%Medium0.006896579059060353https://leetcode.com/problems/flatten-binary-tree-to-linked-list
10588Merge Sorted Array39.4%Easy0.006760335218638243https://leetcode.com/problems/merge-sorted-array
1062Add Two Numbers33.9%Medium0.006737434951993369https://leetcode.com/problems/add-two-numbers
107200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
10883Remove Duplicates from Sorted List45.4%Easy0.006353261522609498https://leetcode.com/problems/remove-duplicates-from-sorted-list
109162Find Peak Element43.3%Medium0.006350235659345837https://leetcode.com/problems/find-peak-element
110105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.005628268691614718https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
111167Two Sum II - Input array is sorted54.1%Easy0.005507380022589096https://leetcode.com/problems/two-sum-ii-input-array-is-sorted
112238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
113198House Robber42.0%Easy0.0037576371128333645https://leetcode.com/problems/house-robber
11494Binary Tree Inorder Traversal63.3%Medium0.0033551449021403577https://leetcode.com/problems/binary-tree-inorder-traversal
11598Validate Binary Search Tree27.8%Medium0.002943776044013381https://leetcode.com/problems/validate-binary-search-tree
116104Maximum Depth of Binary Tree66.0%Easy0.002787846801433134https://leetcode.com/problems/maximum-depth-of-binary-tree
117153Sum26.8%Medium0.0021990113314367685https://leetcode.com/problems/3sum