LeetCode-Questions-CompanyWise/bytedance_alltime.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
2440K-th Smallest in Lexicographical Order29.1%Hard0.6255531303521535https://leetcode.com/problems/k-th-smallest-in-lexicographical-order
3465Optimal Account Balancing46.9%Hard0.5742250229838192https://leetcode.com/problems/optimal-account-balancing
442Trapping Rain Water48.9%Hard0.5642428619989066https://leetcode.com/problems/trapping-rain-water
5493Reverse Pairs25.2%Hard0.5129147546305722https://leetcode.com/problems/reverse-pairs
6351Android Unlock Patterns48.4%Medium0.49324633098632165https://leetcode.com/problems/android-unlock-patterns
725Reverse Nodes in k-Group42.1%Hard0.48439786636995086https://leetcode.com/problems/reverse-nodes-in-k-group
8146LRU Cache33.2%Medium0.4555489526464103https://leetcode.com/problems/lru-cache
9407Trapping Rain Water II42.4%Hard0.4506714555662511https://leetcode.com/problems/trapping-rain-water-ii
10726Number of Atoms49.0%Hard0.44449728439260305https://leetcode.com/problems/number-of-atoms
11403Frog Jump39.7%Hard0.4059129982084613https://leetcode.com/problems/frog-jump
12777Swap Adjacent in LR String34.8%Medium0.38864350930096464https://leetcode.com/problems/swap-adjacent-in-lr-string
13470Implement Rand10() Using Rand7()46.3%Medium0.3541335285236038https://leetcode.com/problems/implement-rand10-using-rand7
141202Smallest String With Swaps46.5%Medium0.3224673282497418https://leetcode.com/problems/smallest-string-with-swaps
151262Greatest Sum Divisible by Three47.6%Medium0.32243762433832857https://leetcode.com/problems/greatest-sum-divisible-by-three
161172Dinner Plate Stacks38.2%Hard0.2711095169699942https://leetcode.com/problems/dinner-plate-stacks
171057Campus Bikes57.7%Medium0.2582475718767295https://leetcode.com/problems/campus-bikes
1831Next Permutation32.6%Medium0.25803390004081306https://leetcode.com/problems/next-permutation
19670Maximum Swap43.6%Medium0.22954743651352366https://leetcode.com/problems/maximum-swap
20143Reorder List37.1%Medium0.21178045827645292https://leetcode.com/problems/reorder-list
2133Search in Rotated Sorted Array34.5%Medium0.1881816310890415https://leetcode.com/problems/search-in-rotated-sorted-array
22681Next Closest Time45.0%Medium0.18812615225992188https://leetcode.com/problems/next-closest-time
23445Add Two Numbers II54.5%Medium0.1810800917058897https://leetcode.com/problems/add-two-numbers-ii
241283Find the Smallest Divisor Given a Threshold47.6%Medium0.17884755718277986https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
251235Maximum Profit in Job Scheduling44.0%Hard0.1532629744871177https://leetcode.com/problems/maximum-profit-in-job-scheduling
26695Max Area of Island62.7%Medium0.1453113999428855https://leetcode.com/problems/max-area-of-island
27317Shortest Distance from All Buildings41.4%Hard0.14387423888417297https://leetcode.com/problems/shortest-distance-from-all-buildings
2851N-Queens46.6%Hard0.13868338753395068https://leetcode.com/problems/n-queens
29449Serialize and Deserialize BST52.0%Medium0.1327502812764459https://leetcode.com/problems/serialize-and-deserialize-bst
30316Remove Duplicate Letters35.8%Hard0.1165801830326188https://leetcode.com/problems/remove-duplicate-letters
31240Search a 2D Matrix II43.2%Medium0.1149245296604198https://leetcode.com/problems/search-a-2d-matrix-ii
32329Longest Increasing Path in a Matrix43.4%Hard0.11459264165812869https://leetcode.com/problems/longest-increasing-path-in-a-matrix
33215Kth Largest Element in an Array55.4%Medium0.11179140598811674https://leetcode.com/problems/kth-largest-element-in-an-array
34199Binary Tree Right Side View54.1%Medium0.10921403017749272https://leetcode.com/problems/binary-tree-right-side-view
35856Score of Parentheses60.5%Medium0.09997219291013618https://leetcode.com/problems/score-of-parentheses
36207Course Schedule43.1%Medium0.09601114875296962https://leetcode.com/problems/course-schedule
373Longest Substring Without Repeating Characters30.4%Medium0.0949810653845502https://leetcode.com/problems/longest-substring-without-repeating-characters
38395Longest Substring with At Least K Repeating Characters41.4%Medium0.09358079943969791https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters
39320Generalized Abbreviation52.1%Medium0.09352605801082346https://leetcode.com/problems/generalized-abbreviation
40282Expression Add Operators35.5%Hard0.08720118433574389https://leetcode.com/problems/expression-add-operators
41206Reverse Linked List62.5%Easy0.08096580890872224https://leetcode.com/problems/reverse-linked-list
4223Merge k Sorted Lists40.2%Hard0.07900382769570498https://leetcode.com/problems/merge-k-sorted-lists
4354Spiral Matrix34.1%Medium0.07792846120043545https://leetcode.com/problems/spiral-matrix
44236Lowest Common Ancestor of a Binary Tree45.7%Medium0.07288369759447264https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
4578Subsets62.0%Medium0.0721466627971786https://leetcode.com/problems/subsets
46406Queue Reconstruction by Height66.9%Medium0.06917190648877243https://leetcode.com/problems/queue-reconstruction-by-height
47386Lexicographical Numbers51.6%Medium0.06875559541512997https://leetcode.com/problems/lexicographical-numbers
4856Merge Intervals39.3%Medium0.06807635025869622https://leetcode.com/problems/merge-intervals
49148Sort List42.3%Medium0.06805346324501566https://leetcode.com/problems/sort-list
50863All Nodes Distance K in Binary Tree55.4%Medium0.06616716425077336https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree
5171Simplify Path32.6%Medium0.06351340572232586https://leetcode.com/problems/simplify-path
52772Basic Calculator III41.3%Hard0.06331227941432688https://leetcode.com/problems/basic-calculator-iii
5372Edit Distance44.8%Hard0.061024299119344635https://leetcode.com/problems/edit-distance
544Median of Two Sorted Arrays29.6%Hard0.0606476084726819https://leetcode.com/problems/median-of-two-sorted-arrays
5541First Missing Positive32.0%Hard0.056273635982108605https://leetcode.com/problems/first-missing-positive
561249Minimum Remove to Make Valid Parentheses62.5%Medium0.05613145611169511https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses
57222Count Complete Tree Nodes46.8%Medium0.05492114472894792https://leetcode.com/problems/count-complete-tree-nodes
58735Asteroid Collision41.0%Medium0.05479154882968245https://leetcode.com/problems/asteroid-collision
59179Largest Number28.8%Medium0.0543427413161019https://leetcode.com/problems/largest-number
601339Maximum Product of Splitted Binary Tree37.2%Medium0.05064373281875492https://leetcode.com/problems/maximum-product-of-splitted-binary-tree
61124Binary Tree Maximum Path Sum34.3%Hard0.048717521186547104https://leetcode.com/problems/binary-tree-maximum-path-sum
62958Check Completeness of a Binary Tree52.1%Medium0.0483185772708077https://leetcode.com/problems/check-completeness-of-a-binary-tree
6311Container With Most Water50.8%Medium0.047988816105494686https://leetcode.com/problems/container-with-most-water
64543Diameter of Binary Tree48.4%Easy0.04676784186766119https://leetcode.com/problems/diameter-of-binary-tree
65415Add Strings47.5%Easy0.04650270606183304https://leetcode.com/problems/add-strings
661Two Sum45.6%Easy0.04514397697084252https://leetcode.com/problems/two-sum
67347Top K Frequent Elements61.2%Medium0.04399269847160566https://leetcode.com/problems/top-k-frequent-elements
68160Intersection of Two Linked Lists40.6%Easy0.043270781043381126https://leetcode.com/problems/intersection-of-two-linked-lists
6953Maximum Subarray46.5%Easy0.04299340685592046https://leetcode.com/problems/maximum-subarray
702Add Two Numbers33.9%Medium0.04138293231479875https://leetcode.com/problems/add-two-numbers
7179Word Search35.6%Medium0.0408086655410548https://leetcode.com/problems/word-search
72162Find Peak Element43.3%Medium0.039043060072524054https://leetcode.com/problems/find-peak-element
73402Remove K Digits28.4%Medium0.03755134565213245https://leetcode.com/problems/remove-k-digits
74322Coin Change35.5%Medium0.03569682997206547https://leetcode.com/problems/coin-change
7521Merge Two Sorted Lists53.5%Easy0.03548634253021285https://leetcode.com/problems/merge-two-sorted-lists
76974Subarray Sums Divisible by K48.9%Medium0.03367321510658789https://leetcode.com/problems/subarray-sums-divisible-by-k
77209Minimum Size Subarray Sum38.2%Medium0.033239453928687726https://leetcode.com/problems/minimum-size-subarray-sum
7844Wildcard Matching24.7%Hard0.030573033362282363https://leetcode.com/problems/wildcard-matching
79103Binary Tree Zigzag Level Order Traversal48.3%Medium0.0269910535894593https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
8022Generate Parentheses62.7%Medium0.026949997964496694https://leetcode.com/problems/generate-parentheses
8134Find First and Last Position of Element in Sorted Array36.2%Medium0.026256496787488606https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
8276Minimum Window Substring34.6%Hard0.024696424154275233https://leetcode.com/problems/minimum-window-substring
83286Walls and Gates54.5%Medium0.02324334737232728https://leetcode.com/problems/walls-and-gates
84152Maximum Product Subarray31.7%Medium0.022176931045949227https://leetcode.com/problems/maximum-product-subarray
85113Path Sum II46.7%Medium0.021882711249507664https://leetcode.com/problems/path-sum-ii
86698Partition to K Equal Sum Subsets45.0%Medium0.02109782896463587https://leetcode.com/problems/partition-to-k-equal-sum-subsets
87350Intersection of Two Arrays II51.4%Easy0.020680587107206983https://leetcode.com/problems/intersection-of-two-arrays-ii
881143Longest Common Subsequence58.4%Medium0.019772173115579716https://leetcode.com/problems/longest-common-subsequence
89173Binary Search Tree Iterator56.6%Medium0.01899993824490396https://leetcode.com/problems/binary-search-tree-iterator
90121Best Time to Buy and Sell Stock50.5%Easy0.018954919107260947https://leetcode.com/problems/best-time-to-buy-and-sell-stock
91394Decode String50.0%Medium0.0182820448374491https://leetcode.com/problems/decode-string
92314Binary Tree Vertical Order Traversal45.3%Medium0.018010392274465332https://leetcode.com/problems/binary-tree-vertical-order-traversal
93239Sliding Window Maximum43.0%Hard0.01768566434627554https://leetcode.com/problems/sliding-window-maximum
9446Permutations63.5%Medium0.016759583649075344https://leetcode.com/problems/permutations
95110Balanced Binary Tree43.5%Easy0.015742847432510365https://leetcode.com/problems/balanced-binary-tree
96105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.01261934861981589https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
9719Remove Nth Node From End of List35.2%Medium0.012249425864399291https://leetcode.com/problems/remove-nth-node-from-end-of-list
98523Continuous Subarray Sum24.6%Medium0.011816976504784561https://leetcode.com/problems/continuous-subarray-sum
9998Validate Binary Search Tree27.8%Medium0.01172346369605921https://leetcode.com/problems/validate-binary-search-tree
10055Jump Game34.6%Medium0.011265609194218986https://leetcode.com/problems/jump-game
10192Reverse Linked List II38.8%Medium0.010427623162259089https://leetcode.com/problems/reverse-linked-list-ii
102212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
103295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
104153Sum26.8%Medium0.00876717944353383https://leetcode.com/problems/3sum
105139Word Break40.1%Medium0.008741314401573542https://leetcode.com/problems/word-break
106977Squares of a Sorted Array72.1%Easy0.008733679968754604https://leetcode.com/problems/squares-of-a-sorted-array
107349Intersection of Two Arrays62.5%Easy0.00725034896230682https://leetcode.com/problems/intersection-of-two-arrays
10810Regular Expression Matching26.8%Hard0.0071865203293987245https://leetcode.com/problems/regular-expression-matching
109114Flatten Binary Tree to Linked List49.3%Medium0.006896579059060353https://leetcode.com/problems/flatten-binary-tree-to-linked-list
11088Merge Sorted Array39.4%Easy0.006760335218638243https://leetcode.com/problems/merge-sorted-array
111200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
11283Remove Duplicates from Sorted List45.4%Easy0.006353261522609498https://leetcode.com/problems/remove-duplicates-from-sorted-list
113167Two Sum II - Input array is sorted54.1%Easy0.005507380022589096https://leetcode.com/problems/two-sum-ii-input-array-is-sorted
114238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
115198House Robber42.0%Easy0.0037576371128333645https://leetcode.com/problems/house-robber
11694Binary Tree Inorder Traversal63.3%Medium0.0033551449021403577https://leetcode.com/problems/binary-tree-inorder-traversal
117104Maximum Depth of Binary Tree66.0%Easy0.002787846801433134https://leetcode.com/problems/maximum-depth-of-binary-tree