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