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

9.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2407Trapping Rain Water II42.4%Hard0.4353602275534239https://leetcode.com/problems/trapping-rain-water-ii
3403Frog Jump39.7%Hard0.3149429241272629https://leetcode.com/problems/frog-jump
4493Reverse Pairs25.2%Hard0.29808060746524384https://leetcode.com/problems/reverse-pairs
5465Optimal Account Balancing46.9%Hard0.2724762777514157https://leetcode.com/problems/optimal-account-balancing
625Reverse Nodes in k-Group42.1%Hard0.15205897432525467https://leetcode.com/problems/reverse-nodes-in-k-group
7726Number of Atoms49.0%Hard0.13804422079620546https://leetcode.com/problems/number-of-atoms
81172Dinner Plate Stacks38.2%Hard0.12963106265293975https://leetcode.com/problems/dinner-plate-stacks
9777Swap Adjacent in LR String34.8%Medium0.11903069645453873https://leetcode.com/problems/swap-adjacent-in-lr-string
10316Remove Duplicate Letters35.8%Hard0.1165801830326188https://leetcode.com/problems/remove-duplicate-letters
11681Next Closest Time45.0%Medium0.11013564249600598https://leetcode.com/problems/next-closest-time
1242Trapping Rain Water48.9%Hard0.10346205022559302https://leetcode.com/problems/trapping-rain-water
13320Generalized Abbreviation52.1%Medium0.09352605801082346https://leetcode.com/problems/generalized-abbreviation
14146LRU Cache33.2%Medium0.08926627755405464https://leetcode.com/problems/lru-cache
15351Android Unlock Patterns48.4%Medium0.07197349962508924https://leetcode.com/problems/android-unlock-patterns
16386Lexicographical Numbers51.6%Medium0.06875559541512997https://leetcode.com/problems/lexicographical-numbers
1751N-Queens46.6%Hard0.06402185876493102https://leetcode.com/problems/n-queens
18772Basic Calculator III41.3%Hard0.06331227941432688https://leetcode.com/problems/basic-calculator-iii
19735Asteroid Collision41.0%Medium0.05479154882968245https://leetcode.com/problems/asteroid-collision
201339Maximum Product of Splitted Binary Tree37.2%Medium0.05064373281875492https://leetcode.com/problems/maximum-product-of-splitted-binary-tree
21282Expression Add Operators35.5%Hard0.049982640867735496https://leetcode.com/problems/expression-add-operators
22449Serialize and Deserialize BST52.0%Medium0.049844204077291364https://leetcode.com/problems/serialize-and-deserialize-bst
231283Find the Smallest Divisor Given a Threshold47.6%Medium0.047798823737776906https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
241235Maximum Profit in Job Scheduling44.0%Hard0.040573516447166516https://leetcode.com/problems/maximum-profit-in-job-scheduling
25402Remove K Digits28.4%Medium0.03755134565213245https://leetcode.com/problems/remove-k-digits
2631Next Permutation32.6%Medium0.03686102113159897https://leetcode.com/problems/next-permutation
271249Minimum Remove to Make Valid Parentheses62.5%Medium0.03628515973976445https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses
28974Subarray Sums Divisible by K48.9%Medium0.03367321510658789https://leetcode.com/problems/subarray-sums-divisible-by-k
29207Course Schedule43.1%Medium0.030628389490117876https://leetcode.com/problems/course-schedule
3044Wildcard Matching24.7%Hard0.030573033362282363https://leetcode.com/problems/wildcard-matching
31240Search a 2D Matrix II43.2%Medium0.02999287612403949https://leetcode.com/problems/search-a-2d-matrix-ii
32143Reorder List37.1%Medium0.025870945598649286https://leetcode.com/problems/reorder-list
33395Longest Substring with At Least K Repeating Characters41.4%Medium0.024228925974379843https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters
34215Kth Largest Element in an Array55.4%Medium0.02414409892936099https://leetcode.com/problems/kth-largest-element-in-an-array
35199Binary Tree Right Side View54.1%Medium0.022539339846061532https://leetcode.com/problems/binary-tree-right-side-view
36698Partition to K Equal Sum Subsets45.0%Medium0.02109782896463587https://leetcode.com/problems/partition-to-k-equal-sum-subsets
37543Diameter of Binary Tree48.4%Easy0.02105617995251665https://leetcode.com/problems/diameter-of-binary-tree
38670Maximum Swap43.6%Medium0.020844944430365928https://leetcode.com/problems/maximum-swap
3979Word Search35.6%Medium0.020204373427427723https://leetcode.com/problems/word-search
401143Longest Common Subsequence58.4%Medium0.019772173115579716https://leetcode.com/problems/longest-common-subsequence
41173Binary Search Tree Iterator56.6%Medium0.01899993824490396https://leetcode.com/problems/binary-search-tree-iterator
42347Top K Frequent Elements61.2%Medium0.018049036874660983https://leetcode.com/problems/top-k-frequent-elements
43406Queue Reconstruction by Height66.9%Medium0.01774669468133533https://leetcode.com/problems/queue-reconstruction-by-height
4478Subsets62.0%Medium0.014669741389982694https://leetcode.com/problems/subsets
45222Count Complete Tree Nodes46.8%Medium0.014015646388344492https://leetcode.com/problems/count-complete-tree-nodes
463Longest Substring Without Repeating Characters30.4%Medium0.01391434345649413https://leetcode.com/problems/longest-substring-without-repeating-characters
47179Largest Number28.8%Medium0.013865040137171665https://leetcode.com/problems/largest-number
4856Merge Intervals39.3%Medium0.013819532422258866https://leetcode.com/problems/merge-intervals
49329Longest Increasing Path in a Matrix43.4%Hard0.013400535537482126https://leetcode.com/problems/longest-increasing-path-in-a-matrix
5033Search in Rotated Sorted Array34.5%Medium0.012857779194289386https://leetcode.com/problems/search-in-rotated-sorted-array
51695Max Area of Island62.7%Medium0.012686500631003836https://leetcode.com/problems/max-area-of-island
52124Binary Tree Maximum Path Sum34.3%Hard0.012403687139326226https://leetcode.com/problems/binary-tree-maximum-path-sum
53350Intersection of Two Arrays II51.4%Easy0.01168540951877908https://leetcode.com/problems/intersection-of-two-arrays-ii
54148Sort List42.3%Medium0.011204599012863078https://leetcode.com/problems/sort-list
55236Lowest Common Ancestor of a Binary Tree45.7%Medium0.010575891759058162https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
5692Reverse Linked List II38.8%Medium0.010427623162259089https://leetcode.com/problems/reverse-linked-list-ii
5772Edit Distance44.8%Hard0.010017614452317782https://leetcode.com/problems/edit-distance
5822Generate Parentheses62.7%Medium0.009785877810632554https://leetcode.com/problems/generate-parentheses
5934Find 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
6023Merge k Sorted Lists40.2%Hard0.009092808657599025https://leetcode.com/problems/merge-k-sorted-lists
61322Coin Change35.5%Medium0.00904437880665999https://leetcode.com/problems/coin-change
62139Word Break40.1%Medium0.008741314401573542https://leetcode.com/problems/word-break
63977Squares of a Sorted Array72.1%Easy0.008733679968754604https://leetcode.com/problems/squares-of-a-sorted-array
64209Minimum Size Subarray Sum38.2%Medium0.00841401682484616https://leetcode.com/problems/minimum-size-subarray-sum
65415Add Strings47.5%Easy0.007587289812159497https://leetcode.com/problems/add-strings
66349Intersection of Two Arrays62.5%Easy0.00725034896230682https://leetcode.com/problems/intersection-of-two-arrays
67110Balanced Binary Tree43.5%Easy0.007027435807456887https://leetcode.com/problems/balanced-binary-tree
6819Remove Nth Node From End of List35.2%Medium0.0069087555063702365https://leetcode.com/problems/remove-nth-node-from-end-of-list
69103Binary Tree Zigzag Level Order Traversal48.3%Medium0.006816368572598042https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
7041First Missing Positive32.0%Hard0.0064113058208121855https://leetcode.com/problems/first-missing-positive
71162Find Peak Element43.3%Medium0.006350235659345837https://leetcode.com/problems/find-peak-element
7276Minimum Window Substring34.6%Hard0.006231520398723243https://leetcode.com/problems/minimum-window-substring
73105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.005628268691614718https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
74152Maximum Product Subarray31.7%Medium0.005590510716885066https://leetcode.com/problems/maximum-product-subarray
75206Reverse Linked List62.5%Easy0.005257021452801617https://leetcode.com/problems/reverse-linked-list
7655Jump Game34.6%Medium0.005022612266291382https://leetcode.com/problems/jump-game
7753Maximum Subarray46.5%Easy0.004869349014182134https://leetcode.com/problems/maximum-subarray
78121Best Time to Buy and Sell Stock50.5%Easy0.0047725193990346675https://leetcode.com/problems/best-time-to-buy-and-sell-stock
7946Permutations63.5%Medium0.004216302230139218https://leetcode.com/problems/permutations
804Median of Two Sorted Arrays29.6%Hard0.003900160950094767https://leetcode.com/problems/median-of-two-sorted-arrays
811Two Sum45.6%Easy0.003278422738041615https://leetcode.com/problems/two-sum
8288Merge Sorted Array39.4%Easy0.0030102370714243072https://leetcode.com/problems/merge-sorted-array
83200Number of Islands46.8%Medium0.0028897578265903614https://leetcode.com/problems/number-of-islands
8421Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists