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

11 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2407Trapping Rain Water II42.4%Hard0.4512959462757127https://leetcode.com/problems/trapping-rain-water-ii
3403Frog Jump39.7%Hard0.40653748891792285https://leetcode.com/problems/frog-jump
41202Smallest String With Swaps46.5%Medium0.3430272491675487https://leetcode.com/problems/smallest-string-with-swaps
5493Reverse Pairs25.2%Hard0.33395175639587793https://leetcode.com/problems/reverse-pairs
6465Optimal Account Balancing46.9%Hard0.3083474266820498https://leetcode.com/problems/optimal-account-balancing
7777Swap Adjacent in LR String34.8%Medium0.30093653925373076https://leetcode.com/problems/swap-adjacent-in-lr-string
825Reverse Nodes in k-Group42.1%Hard0.2704051213089347https://leetcode.com/problems/reverse-nodes-in-k-group
91262Greatest Sum Divisible by Three47.6%Medium0.2325914143917342https://leetcode.com/problems/greatest-sum-divisible-by-three
1042Trapping Rain Water48.9%Hard0.16908117464136005https://leetcode.com/problems/trapping-rain-water
11146LRU Cache33.2%Medium0.15357414478678588https://leetcode.com/problems/lru-cache
12726Number of Atoms49.0%Hard0.13804422079620546https://leetcode.com/problems/number-of-atoms
131172Dinner Plate Stacks38.2%Hard0.12963106265293975https://leetcode.com/problems/dinner-plate-stacks
14316Remove Duplicate Letters35.8%Hard0.1165801830326188https://leetcode.com/problems/remove-duplicate-letters
15681Next Closest Time45.0%Medium0.11013564249600598https://leetcode.com/problems/next-closest-time
16320Generalized Abbreviation52.1%Medium0.09352605801082346https://leetcode.com/problems/generalized-abbreviation
17351Android Unlock Patterns48.4%Medium0.07197349962508924https://leetcode.com/problems/android-unlock-patterns
18386Lexicographical Numbers51.6%Medium0.06875559541512997https://leetcode.com/problems/lexicographical-numbers
1951N-Queens46.6%Hard0.06402185876493102https://leetcode.com/problems/n-queens
20772Basic Calculator III41.3%Hard0.06331227941432688https://leetcode.com/problems/basic-calculator-iii
21735Asteroid Collision41.0%Medium0.05479154882968245https://leetcode.com/problems/asteroid-collision
22395Longest Substring with At Least K Repeating Characters41.4%Medium0.05371219359052555https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters
2331Next Permutation32.6%Medium0.05265913800819017https://leetcode.com/problems/next-permutation
24329Longest Increasing Path in a Matrix43.4%Hard0.052557250738676044https://leetcode.com/problems/longest-increasing-path-in-a-matrix
251339Maximum Product of Splitted Binary Tree37.2%Medium0.05064373281875492https://leetcode.com/problems/maximum-product-of-splitted-binary-tree
26282Expression Add Operators35.5%Hard0.049982640867735496https://leetcode.com/problems/expression-add-operators
27449Serialize and Deserialize BST52.0%Medium0.049844204077291364https://leetcode.com/problems/serialize-and-deserialize-bst
281283Find the Smallest Divisor Given a Threshold47.6%Medium0.047798823737776906https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
29240Search a 2D Matrix II43.2%Medium0.04647676584572884https://leetcode.com/problems/search-a-2d-matrix-ii
30856Score of Parentheses60.5%Medium0.04567003683318837https://leetcode.com/problems/score-of-parentheses
31143Reorder List37.1%Medium0.04554002588608351https://leetcode.com/problems/reorder-list
321235Maximum Profit in Job Scheduling44.0%Hard0.040573516447166516https://leetcode.com/problems/maximum-profit-in-job-scheduling
33317Shortest Distance from All Buildings41.4%Hard0.03795522000043556https://leetcode.com/problems/shortest-distance-from-all-buildings
34402Remove K Digits28.4%Medium0.03755134565213245https://leetcode.com/problems/remove-k-digits
351249Minimum Remove to Make Valid Parentheses62.5%Medium0.03628515973976445https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses
36199Binary Tree Right Side View54.1%Medium0.034997972754213943https://leetcode.com/problems/binary-tree-right-side-view
37215Kth Largest Element in an Array55.4%Medium0.03458557964977998https://leetcode.com/problems/kth-largest-element-in-an-array
38974Subarray Sums Divisible by K48.9%Medium0.03367321510658789https://leetcode.com/problems/subarray-sums-divisible-by-k
39207Course Schedule43.1%Medium0.030628389490117876https://leetcode.com/problems/course-schedule
4044Wildcard Matching24.7%Hard0.030573033362282363https://leetcode.com/problems/wildcard-matching
41236Lowest Common Ancestor of a Binary Tree45.7%Medium0.029105663386885607https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
4233Search in Rotated Sorted Array34.5%Medium0.0287009496170278https://leetcode.com/problems/search-in-rotated-sorted-array
43695Max Area of Island62.7%Medium0.028321590863246118https://leetcode.com/problems/max-area-of-island
44445Add Two Numbers II54.5%Medium0.02753309435998931https://leetcode.com/problems/add-two-numbers-ii
4579Word Search35.6%Medium0.026308653156300807https://leetcode.com/problems/word-search
4623Merge k Sorted Lists40.2%Hard0.0250564321052577https://leetcode.com/problems/merge-k-sorted-lists
473Longest Substring Without Repeating Characters30.4%Medium0.024604324231039386https://leetcode.com/problems/longest-substring-without-repeating-characters
4878Subsets62.0%Medium0.022827872206034577https://leetcode.com/problems/subsets
4972Edit Distance44.8%Hard0.022400140173127806https://leetcode.com/problems/edit-distance
50124Binary Tree Maximum Path Sum34.3%Hard0.021945744272529284https://leetcode.com/problems/binary-tree-maximum-path-sum
51698Partition to K Equal Sum Subsets45.0%Medium0.02109782896463587https://leetcode.com/problems/partition-to-k-equal-sum-subsets
52543Diameter of Binary Tree48.4%Easy0.02105617995251665https://leetcode.com/problems/diameter-of-binary-tree
53670Maximum Swap43.6%Medium0.020844944430365928https://leetcode.com/problems/maximum-swap
541143Longest Common Subsequence58.4%Medium0.019772173115579716https://leetcode.com/problems/longest-common-subsequence
55173Binary Search Tree Iterator56.6%Medium0.01899993824490396https://leetcode.com/problems/binary-search-tree-iterator
56347Top K Frequent Elements61.2%Medium0.018049036874660983https://leetcode.com/problems/top-k-frequent-elements
57406Queue Reconstruction by Height66.9%Medium0.01774669468133533https://leetcode.com/problems/queue-reconstruction-by-height
58415Add Strings47.5%Easy0.016991158247219373https://leetcode.com/problems/add-strings
5941First Missing Positive32.0%Hard0.014368063266920193https://leetcode.com/problems/first-missing-positive
60222Count Complete Tree Nodes46.8%Medium0.014015646388344492https://leetcode.com/problems/count-complete-tree-nodes
6176Minimum Window Substring34.6%Hard0.013966707481708198https://leetcode.com/problems/minimum-window-substring
62179Largest Number28.8%Medium0.013865040137171665https://leetcode.com/problems/largest-number
6356Merge Intervals39.3%Medium0.013819532422258866https://leetcode.com/problems/merge-intervals
64523Continuous Subarray Sum24.6%Medium0.011816976504784561https://leetcode.com/problems/continuous-subarray-sum
65350Intersection of Two Arrays II51.4%Easy0.01168540951877908https://leetcode.com/problems/intersection-of-two-arrays-ii
66148Sort List42.3%Medium0.011204599012863078https://leetcode.com/problems/sort-list
6792Reverse Linked List II38.8%Medium0.010427623162259089https://leetcode.com/problems/reverse-linked-list-ii
6822Generate Parentheses62.7%Medium0.009785877810632554https://leetcode.com/problems/generate-parentheses
69113Path Sum II46.7%Medium0.009784813879998279https://leetcode.com/problems/path-sum-ii
7034Find 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
7146Permutations63.5%Medium0.009461803137288448https://leetcode.com/problems/permutations
72206Reverse Linked List62.5%Easy0.009326794511974934https://leetcode.com/problems/reverse-linked-list
73322Coin Change35.5%Medium0.00904437880665999https://leetcode.com/problems/coin-change
74295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
75139Word Break40.1%Medium0.008741314401573542https://leetcode.com/problems/word-break
76977Squares of a Sorted Array72.1%Easy0.008733679968754604https://leetcode.com/problems/squares-of-a-sorted-array
77209Minimum Size Subarray Sum38.2%Medium0.00841401682484616https://leetcode.com/problems/minimum-size-subarray-sum
78239Sliding Window Maximum43.0%Hard0.007898935224534491https://leetcode.com/problems/sliding-window-maximum
79349Intersection of Two Arrays62.5%Easy0.00725034896230682https://leetcode.com/problems/intersection-of-two-arrays
80110Balanced Binary Tree43.5%Easy0.007027435807456887https://leetcode.com/problems/balanced-binary-tree
8119Remove Nth Node From End of List35.2%Medium0.0069087555063702365https://leetcode.com/problems/remove-nth-node-from-end-of-list
82103Binary Tree Zigzag Level Order Traversal48.3%Medium0.006816368572598042https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
8354Spiral Matrix34.1%Medium0.0065941551175130245https://leetcode.com/problems/spiral-matrix
84200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
85162Find Peak Element43.3%Medium0.006350235659345837https://leetcode.com/problems/find-peak-element
86105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.005628268691614718https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
87152Maximum Product Subarray31.7%Medium0.005590510716885066https://leetcode.com/problems/maximum-product-subarray
881Two Sum45.6%Easy0.0051178232035212715https://leetcode.com/problems/two-sum
8921Merge Two Sorted Lists53.5%Easy0.005067007800877041https://leetcode.com/problems/merge-two-sorted-lists
9055Jump Game34.6%Medium0.005022612266291382https://leetcode.com/problems/jump-game
9153Maximum Subarray46.5%Easy0.004869349014182134https://leetcode.com/problems/maximum-subarray
92121Best Time to Buy and Sell Stock50.5%Easy0.0047725193990346675https://leetcode.com/problems/best-time-to-buy-and-sell-stock
934Median of Two Sorted Arrays29.6%Hard0.003900160950094767https://leetcode.com/problems/median-of-two-sorted-arrays
94198House Robber42.0%Easy0.0037576371128333645https://leetcode.com/problems/house-robber
9511Container With Most Water50.8%Medium0.0030677223230101427https://leetcode.com/problems/container-with-most-water
9688Merge Sorted Array39.4%Easy0.0030102370714243072https://leetcode.com/problems/merge-sorted-array
9798Validate Binary Search Tree27.8%Medium0.002943776044013381https://leetcode.com/problems/validate-binary-search-tree
982Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers