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

148 lines
17 KiB
CSV

ID,Title,Acceptance,Difficulty,Frequency,Leetcode Question Link
1396,Design Underground System,64.7%,Medium,1.6336239764997664, https://leetcode.com/problems/design-underground-system
1274,Number of Ships in a Rectangle,66.3%,Hard,1.3841012723467938, https://leetcode.com/problems/number-of-ships-in-a-rectangle
1169,Invalid Transactions,31.2%,Medium,1.1345785681938212, https://leetcode.com/problems/invalid-transactions
1209,Remove All Adjacent Duplicates in String II,56.9%,Medium,0.9182875611040503, https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii
394,Decode String,50.0%,Medium,0.8695403064407496, https://leetcode.com/problems/decode-string
430,Flatten a Multilevel Doubly Linked List,55.1%,Medium,0.620017602287777, https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list
200,Number of Islands,46.8%,Medium,0.581027429947078, https://leetcode.com/problems/number-of-islands
253,Meeting Rooms II,45.7%,Medium,0.46127061637748534, https://leetcode.com/problems/meeting-rooms-ii
1472,Design Browser History,64.6%,Medium,0.41985384556026395, https://leetcode.com/problems/design-browser-history
146,LRU Cache,33.2%,Medium,0.4110212101491863, https://leetcode.com/problems/lru-cache
445,Add Two Numbers II,54.5%,Medium,0.3186792865497379, https://leetcode.com/problems/add-two-numbers-ii
987,Vertical Order Traversal of a Binary Tree,36.6%,Medium,0.30230623809780655, https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree
1029,Two City Scheduling,56.1%,Easy,0.23361485118150516, https://leetcode.com/problems/two-city-scheduling
98,Validate Binary Search Tree,27.8%,Medium,0.21414088449315205, https://leetcode.com/problems/validate-binary-search-tree
117,Populating Next Right Pointers in Each Node II,39.1%,Medium,0.20860539286818253, https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii
1244,Design A Leaderboard,60.7%,Medium,0.17763094743610072, https://leetcode.com/problems/design-a-leaderboard
387,First Unique Character in a String,53.4%,Easy,0.16314262087986708, https://leetcode.com/problems/first-unique-character-in-a-string
2,Add Two Numbers,33.9%,Medium,0.15615258592389064, https://leetcode.com/problems/add-two-numbers
723,Candy Crush,69.2%,Medium,0.1475667107409061, https://leetcode.com/problems/candy-crush
380,Insert Delete GetRandom O(1),47.5%,Medium,0.1466146891661091, https://leetcode.com/problems/insert-delete-getrandom-o1
384,Shuffle an Array,52.8%,Medium,0.12953764257899986, https://leetcode.com/problems/shuffle-an-array
42,Trapping Rain Water,48.9%,Hard,0.12389276378675394, https://leetcode.com/problems/trapping-rain-water
451,Sort Characters By Frequency,63.0%,Medium,0.11258362132121401, https://leetcode.com/problems/sort-characters-by-frequency
155,Min Stack,44.5%,Easy,0.11244000234885869, https://leetcode.com/problems/min-stack
1188,Design Bounded Blocking Queue,70.5%,Medium,0.11030454201470608, https://leetcode.com/problems/design-bounded-blocking-queue
924,Minimize Malware Spread,42.0%,Hard,0.10821358464023274, https://leetcode.com/problems/minimize-malware-spread
314,Binary Tree Vertical Order Traversal,45.3%,Medium,0.10758430200165091, https://leetcode.com/problems/binary-tree-vertical-order-traversal
658,Find K Closest Elements,40.9%,Medium,0.0995648587647672, https://leetcode.com/problems/find-k-closest-elements
611,Valid Triangle Number,48.4%,Medium,0.09333193979221914, https://leetcode.com/problems/valid-triangle-number
20,Valid Parentheses,39.0%,Easy,0.09286263438126167, https://leetcode.com/problems/valid-parentheses
991,Broken Calculator,45.6%,Medium,0.08515780834030685, https://leetcode.com/problems/broken-calculator
582,Kill Process,60.8%,Medium,0.08355588569097351, https://leetcode.com/problems/kill-process
56,Merge Intervals,39.3%,Medium,0.08339552430579078, https://leetcode.com/problems/merge-intervals
1297,Maximum Number of Occurrences of a Substring,47.3%,Medium,0.07770898432731625, https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring
1347,Minimum Number of Steps to Make Two Strings Anagram,74.7%,Medium,0.07742472477971579, https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram
214,Shortest Palindrome,29.8%,Hard,0.0753494372417868, https://leetcode.com/problems/shortest-palindrome
463,Island Perimeter,65.7%,Easy,0.06646080650226213, https://leetcode.com/problems/island-perimeter
1145,Binary Tree Coloring Game,51.2%,Medium,0.06592172080482424, https://leetcode.com/problems/binary-tree-coloring-game
242,Valid Anagram,56.9%,Easy,0.06447998055429512, https://leetcode.com/problems/valid-anagram
3,Longest Substring Without Repeating Characters,30.4%,Medium,0.06370380162663494, https://leetcode.com/problems/longest-substring-without-repeating-characters
353,Design Snake Game,34.2%,Medium,0.06053284922884233, https://leetcode.com/problems/design-snake-game
1,Two Sum,45.6%,Easy,0.057621231679235815, https://leetcode.com/problems/two-sum
128,Longest Consecutive Sequence,45.1%,Hard,0.05527490034186498, https://leetcode.com/problems/longest-consecutive-sequence
1054,Distant Barcodes,43.2%,Medium,0.054435206555017046, https://leetcode.com/problems/distant-barcodes
12,Integer to Roman,55.1%,Medium,0.05217122936969127, https://leetcode.com/problems/integer-to-roman
286,Walls and Gates,54.5%,Medium,0.05155780966485001, https://leetcode.com/problems/walls-and-gates
1312,Minimum Insertion Steps to Make a String Palindrome,58.1%,Hard,0.050261834780888255, https://leetcode.com/problems/minimum-insertion-steps-to-make-a-string-palindrome
10,Regular Expression Matching,26.8%,Hard,0.04409107726484965, https://leetcode.com/problems/regular-expression-matching
140,Word Break II,32.6%,Hard,0.04245795568707049, https://leetcode.com/problems/word-break-ii
1155,Number of Dice Rolls With Target Sum,49.0%,Medium,0.04204262329555109, https://leetcode.com/problems/number-of-dice-rolls-with-target-sum
33,Search in Rotated Sorted Array,34.5%,Medium,0.03886602267922457, https://leetcode.com/problems/search-in-rotated-sorted-array
797,All Paths From Source to Target,77.9%,Medium,0.03881156536434583, https://leetcode.com/problems/all-paths-from-source-to-target
138,Copy List with Random Pointer,36.4%,Medium,0.03807953223592622, https://leetcode.com/problems/copy-list-with-random-pointer
139,Word Break,40.1%,Medium,0.03451593709018879, https://leetcode.com/problems/word-break
53,Maximum Subarray,46.5%,Easy,0.03412208634661372, https://leetcode.com/problems/maximum-subarray
79,Word Search,35.6%,Medium,0.03318208821436187, https://leetcode.com/problems/word-search
694,Number of Distinct Islands,56.0%,Medium,0.03278982282299087, https://leetcode.com/problems/number-of-distinct-islands
1123,Lowest Common Ancestor of Deepest Leaves,66.8%,Medium,0.03147388037973136, https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves
460,LFU Cache,34.2%,Hard,0.030962225603966897, https://leetcode.com/problems/lfu-cache
332,Reconstruct Itinerary,36.7%,Medium,0.030687713231237448, https://leetcode.com/problems/reconstruct-itinerary
85,Maximal Rectangle,37.7%,Hard,0.029754261081792705, https://leetcode.com/problems/maximal-rectangle
695,Max Area of Island,62.7%,Medium,0.028321590863246118, https://leetcode.com/problems/max-area-of-island
518,Coin Change 2,50.2%,Medium,0.027969505010125056, https://leetcode.com/problems/coin-change-2
121,Best Time to Buy and Sell Stock,50.5%,Easy,0.0257124040167447, https://leetcode.com/problems/best-time-to-buy-and-sell-stock
283,Move Zeroes,57.8%,Easy,0.025673520193393074, https://leetcode.com/problems/move-zeroes
90,Subsets II,47.1%,Medium,0.025497131933483772, https://leetcode.com/problems/subsets-ii
41,First Missing Positive,32.0%,Hard,0.02540222313806603, https://leetcode.com/problems/first-missing-positive
322,Coin Change,35.5%,Medium,0.024924029676386045, https://leetcode.com/problems/coin-change
30,Substring with Concatenation of All Words,25.4%,Hard,0.02486144206532915, https://leetcode.com/problems/substring-with-concatenation-of-all-words
752,Open the Lock,51.8%,Medium,0.024586364440127736, https://leetcode.com/problems/open-the-lock
395,Longest Substring with At Least K Repeating Characters,41.4%,Medium,0.024228925974379843, https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters
348,Design Tic-Tac-Toe,54.3%,Medium,0.024214258120594613, https://leetcode.com/problems/design-tic-tac-toe
662,Maximum Width of Binary Tree,41.0%,Medium,0.024116924478312346, https://leetcode.com/problems/maximum-width-of-binary-tree
78,Subsets,62.0%,Medium,0.022827872206034577, https://leetcode.com/problems/subsets
102,Binary Tree Level Order Traversal,54.6%,Medium,0.02252956425342345, https://leetcode.com/problems/binary-tree-level-order-traversal
285,Inorder Successor in BST,40.4%,Medium,0.02233482010057984, https://leetcode.com/problems/inorder-successor-in-bst
105,Construct Binary Tree from Preorder and Inorder Traversal,48.8%,Medium,0.022325470299025416, https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
221,Maximal Square,37.7%,Medium,0.022108490754203434, https://leetcode.com/problems/maximal-square
424,Longest Repeating Character Replacement,47.0%,Medium,0.020461071871340063, https://leetcode.com/problems/longest-repeating-character-replacement
5,Longest Palindromic Substring,29.5%,Medium,0.020329346568668867, https://leetcode.com/problems/longest-palindromic-substring
784,Letter Case Permutation,64.6%,Medium,0.02026411791905559, https://leetcode.com/problems/letter-case-permutation
69,Sqrt(x),33.9%,Easy,0.020253856904497686, https://leetcode.com/problems/sqrtx
15,3Sum,26.8%,Medium,0.019619157889188592, https://leetcode.com/problems/3sum
399,Evaluate Division,51.6%,Medium,0.019380451549662482, https://leetcode.com/problems/evaluate-division
721,Accounts Merge,48.8%,Medium,0.01888630262874805, https://leetcode.com/problems/accounts-merge
209,Minimum Size Subarray Sum,38.2%,Medium,0.018832948333092125, https://leetcode.com/problems/minimum-size-subarray-sum
88,Merge Sorted Array,39.4%,Easy,0.018667009593356397, https://leetcode.com/problems/merge-sorted-array
84,Largest Rectangle in Histogram,35.2%,Hard,0.01866112622166295, https://leetcode.com/problems/largest-rectangle-in-histogram
126,Word Ladder II,22.1%,Hard,0.017994187717865196, https://leetcode.com/problems/word-ladder-ii
292,Nim Game,54.9%,Easy,0.01796186592859277, https://leetcode.com/problems/nim-game
6,ZigZag Conversion,36.3%,Medium,0.01726827253226344, https://leetcode.com/problems/zigzag-conversion
402,Remove K Digits,28.4%,Medium,0.016863806052004816, https://leetcode.com/problems/remove-k-digits
692,Top K Frequent Words,51.8%,Medium,0.016832265743172113, https://leetcode.com/problems/top-k-frequent-words
188,Best Time to Buy and Sell Stock IV,28.0%,Hard,0.01651565203072114, https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv
116,Populating Next Right Pointers in Each Node,45.2%,Medium,0.016432723251567683, https://leetcode.com/problems/populating-next-right-pointers-in-each-node
23,Merge k Sorted Lists,40.2%,Hard,0.016108271385328228, https://leetcode.com/problems/merge-k-sorted-lists
4,Median of Two Sorted Arrays,29.6%,Hard,0.015510198481701449, https://leetcode.com/problems/median-of-two-sorted-arrays
315,Count of Smaller Numbers After Self,41.5%,Hard,0.014352596574956585, https://leetcode.com/problems/count-of-smaller-numbers-after-self
21,Merge Two Sorted Lists,53.5%,Easy,0.014012111332134735, https://leetcode.com/problems/merge-two-sorted-lists
404,Sum of Left Leaves,50.9%,Easy,0.013981353230340547, https://leetcode.com/problems/sum-of-left-leaves
724,Find Pivot Index,44.0%,Easy,0.013850636933899008, https://leetcode.com/problems/find-pivot-index
44,Wildcard Matching,24.7%,Hard,0.013703537497261858, https://leetcode.com/problems/wildcard-matching
101,Symmetric Tree,46.8%,Easy,0.013553786479814183, https://leetcode.com/problems/symmetric-tree
127,Word Ladder,29.6%,Medium,0.013403030127340374, https://leetcode.com/problems/word-ladder
347,Top K Frequent Elements,61.2%,Medium,0.01329217620893675, https://leetcode.com/problems/top-k-frequent-elements
152,Maximum Product Subarray,31.7%,Medium,0.012534983069696118, https://leetcode.com/problems/maximum-product-subarray
112,Path Sum,41.2%,Easy,0.012265076074932503, https://leetcode.com/problems/path-sum
273,Integer to English Words,27.1%,Hard,0.012081089250339716, https://leetcode.com/problems/integer-to-english-words
123,Best Time to Buy and Sell Stock III,37.5%,Hard,0.011261380272539033, https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii
338,Counting Bits,69.5%,Medium,0.01088446119842327, https://leetcode.com/problems/counting-bits
92,Reverse Linked List II,38.8%,Medium,0.010427623162259089, https://leetcode.com/problems/reverse-linked-list-ii
234,Palindrome Linked List,39.3%,Easy,0.010171877938733932, https://leetcode.com/problems/palindrome-linked-list
621,Task Scheduler,50.1%,Medium,0.009334412329990095, https://leetcode.com/problems/task-scheduler
1249,Minimum Remove to Make Valid Parentheses,62.5%,Medium,0.009195467093100304, https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses
125,Valid Palindrome,36.7%,Easy,0.008933948641551634, https://leetcode.com/problems/valid-palindrome
49,Group Anagrams,56.9%,Medium,0.008538951314232168, https://leetcode.com/problems/group-anagrams
173,Binary Search Tree Iterator,56.6%,Medium,0.008489015324911316, https://leetcode.com/problems/binary-search-tree-iterator
153,Find Minimum in Rotated Sorted Array,45.1%,Medium,0.008430963288799368, https://leetcode.com/problems/find-minimum-in-rotated-sorted-array
239,Sliding Window Maximum,43.0%,Hard,0.007898935224534491, https://leetcode.com/problems/sliding-window-maximum
328,Odd Even Linked List,55.7%,Medium,0.00764383618585562, https://leetcode.com/problems/odd-even-linked-list
415,Add Strings,47.5%,Easy,0.007587289812159497, https://leetcode.com/problems/add-strings
122,Best Time to Buy and Sell Stock II,57.0%,Easy,0.007532046655581962, https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
412,Fizz Buzz,62.3%,Easy,0.007165921026143679, https://leetcode.com/problems/fizz-buzz
110,Balanced Binary Tree,43.5%,Easy,0.007027435807456887, https://leetcode.com/problems/balanced-binary-tree
114,Flatten Binary Tree to Linked List,49.3%,Medium,0.006896579059060353, https://leetcode.com/problems/flatten-binary-tree-to-linked-list
448,Find All Numbers Disappeared in an Array,55.9%,Easy,0.006863444924982415, https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array
54,Spiral Matrix,34.1%,Medium,0.0065941551175130245, https://leetcode.com/problems/spiral-matrix
136,Single Number,65.5%,Easy,0.006445166968713385, https://leetcode.com/problems/single-number
24,Swap Nodes in Pairs,50.4%,Medium,0.0062218275061505365, https://leetcode.com/problems/swap-nodes-in-pairs
64,Minimum Path Sum,54.5%,Medium,0.006127470152097104, https://leetcode.com/problems/minimum-path-sum
91,Decode Ways,24.7%,Medium,0.005968385368349129, https://leetcode.com/problems/decode-ways
199,Binary Tree Right Side View,54.1%,Medium,0.0056826406650506926, https://leetcode.com/problems/binary-tree-right-side-view
237,Delete Node in a Linked List,63.8%,Easy,0.005144705881237697, https://leetcode.com/problems/delete-node-in-a-linked-list
207,Course Schedule,43.1%,Medium,0.004964021114211758, https://leetcode.com/problems/course-schedule
62,Unique Paths,54.1%,Medium,0.004621080312067025, https://leetcode.com/problems/unique-paths
34,Find First and Last Position of Element in Sorted Array,36.2%,Medium,0.004247643638268045, https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
8,String to Integer (atoi),15.4%,Medium,0.0037925521897059712, https://leetcode.com/problems/string-to-integer-atoi
13,Roman to Integer,55.7%,Easy,0.003428770717317083, https://leetcode.com/problems/roman-to-integer
14,Longest Common Prefix,35.4%,Easy,0.003320331762984143, https://leetcode.com/problems/longest-common-prefix
19,Remove Nth Node From End of List,35.2%,Medium,0.003076452203393495, https://leetcode.com/problems/remove-nth-node-from-end-of-list
1480,Running Sum of 1d Array,90.5%,Easy,0.0026196884456014947, https://leetcode.com/problems/running-sum-of-1d-array
258,Add Digits,57.6%,Easy,0.0020686809197766587, https://leetcode.com/problems/add-digits
26,Remove Duplicates from Sorted Array,45.1%,Easy,0.0019513153174351963, https://leetcode.com/problems/remove-duplicates-from-sorted-array
7,Reverse Integer,25.8%,Easy,0.0018612447790907708, https://leetcode.com/problems/reverse-integer
103,Binary Tree Zigzag Level Order Traversal,48.3%,Medium,0.0017084529846397953, https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
50,Pow(x;n),30.3%,Medium,0.0014016892647828818, https://leetcode.com/problems/powx-n