mirror of
https://github.com/McSmog/LeetCode-Questions-CompanyWise.git
synced 2026-04-19 16:56:45 +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)
```
16 KiB
16 KiB
| 1 | ID | Title | Acceptance | Difficulty | Frequency | Leetcode Question Link |
|---|---|---|---|---|---|---|
| 2 | 244 | Shortest Word Distance II | 52.3% | Medium | 6.080030276326555 | https://leetcode.com/problems/shortest-word-distance-ii |
| 3 | 364 | Nested List Weight Sum II | 62.8% | Medium | 5.858903208882962 | https://leetcode.com/problems/nested-list-weight-sum-ii |
| 4 | 170 | Two Sum III - Data structure design | 33.5% | Easy | 5.339976985176443 | https://leetcode.com/problems/two-sum-iii-data-structure-design |
| 5 | 339 | Nested List Weight Sum | 74.0% | Easy | 4.821050761469923 | https://leetcode.com/problems/nested-list-weight-sum |
| 6 | 272 | Closest Binary Search Tree Value II | 50.5% | Hard | 4.69866052907543 | https://leetcode.com/problems/closest-binary-search-tree-value-ii |
| 7 | 156 | Binary Tree Upside Down | 55.0% | Medium | 4.677621857655682 | https://leetcode.com/problems/binary-tree-upside-down |
| 8 | 716 | Max Stack | 42.6% | Easy | 4.158695633949162 | https://leetcode.com/problems/max-stack |
| 9 | 254 | Factor Combinations | 46.7% | Medium | 4.042679900269238 | https://leetcode.com/problems/factor-combinations |
| 10 | 243 | Shortest Word Distance | 61.0% | Easy | 4.033402295442248 | https://leetcode.com/problems/shortest-word-distance |
| 11 | 366 | Find Leaves of Binary Tree | 70.6% | Medium | 3.8874042537463542 | https://leetcode.com/problems/find-leaves-of-binary-tree |
| 12 | 256 | Paint House | 52.1% | Easy | 3.830168081045509 | https://leetcode.com/problems/paint-house |
| 13 | 265 | Paint House II | 44.6% | Hard | 3.643918157363893 | https://leetcode.com/problems/paint-house-ii |
| 14 | 149 | Max Points on a Line | 16.9% | Hard | 3.593946561618369 | https://leetcode.com/problems/max-points-on-a-line |
| 15 | 65 | Valid Number | 15.3% | Hard | 3.4859422228274832 | https://leetcode.com/problems/valid-number |
| 16 | 605 | Can Place Flowers | 31.6% | Easy | 3.393038148985481 | https://leetcode.com/problems/can-place-flowers |
| 17 | 380 | Insert Delete GetRandom O(1) | 47.5% | Medium | 3.226132922031484 | https://leetcode.com/problems/insert-delete-getrandom-o1 |
| 18 | 432 | All O`one Data Structure | 32.4% | Hard | 3.182278405836062 | https://leetcode.com/problems/all-oone-data-structure |
| 19 | 68 | Text Justification | 27.7% | Hard | 3.1683420251214285 | https://leetcode.com/problems/text-justification |
| 20 | 341 | Flatten Nested List Iterator | 52.9% | Medium | 2.8560409644057407 | https://leetcode.com/problems/flatten-nested-list-iterator |
| 21 | 150 | Evaluate Reverse Polish Notation | 36.3% | Medium | 2.7457641678571494 | https://leetcode.com/problems/evaluate-reverse-polish-notation |
| 22 | 205 | Isomorphic Strings | 39.8% | Easy | 2.6687791722177048 | https://leetcode.com/problems/isomorphic-strings |
| 23 | 245 | Shortest Word Distance III | 55.3% | Medium | 2.4804776643766675 | https://leetcode.com/problems/shortest-word-distance-iii |
| 24 | 297 | Serialize and Deserialize Binary Tree | 47.5% | Hard | 2.4208730516603993 | https://leetcode.com/problems/serialize-and-deserialize-binary-tree |
| 25 | 261 | Graph Valid Tree | 42.2% | Medium | 2.361420232509446 | https://leetcode.com/problems/graph-valid-tree |
| 26 | 611 | Valid Triangle Number | 48.4% | Medium | 2.3166166237983035 | https://leetcode.com/problems/valid-triangle-number |
| 27 | 730 | Count Different Palindromic Subsequences | 41.8% | Hard | 2.3008291662917806 | https://leetcode.com/problems/count-different-palindromic-subsequences |
| 28 | 53 | Maximum Subarray | 46.5% | Easy | 2.234231225147922 | https://leetcode.com/problems/maximum-subarray |
| 29 | 187 | Repeated DNA Sequences | 38.9% | Medium | 2.1034320303164904 | https://leetcode.com/problems/repeated-dna-sequences |
| 30 | 698 | Partition to K Equal Sum Subsets | 45.0% | Medium | 2.0188752204026974 | https://leetcode.com/problems/partition-to-k-equal-sum-subsets |
| 31 | 152 | Maximum Product Subarray | 31.7% | Medium | 2.012330220619989 | https://leetcode.com/problems/maximum-product-subarray |
| 32 | 72 | Edit Distance | 44.8% | Hard | 1.77034719073246 | https://leetcode.com/problems/edit-distance |
| 33 | 200 | Number of Islands | 46.8% | Medium | 1.7486397840620904 | https://leetcode.com/problems/number-of-islands |
| 34 | 277 | Find the Celebrity | 41.8% | Medium | 1.6753413644780486 | https://leetcode.com/problems/find-the-celebrity |
| 35 | 56 | Merge Intervals | 39.3% | Medium | 1.660437199438034 | https://leetcode.com/problems/merge-intervals |
| 36 | 516 | Longest Palindromic Subsequence | 53.2% | Medium | 1.6283626316034112 | https://leetcode.com/problems/longest-palindromic-subsequence |
| 37 | 671 | Second Minimum Node In a Binary Tree | 42.7% | Easy | 1.6037158670068572 | https://leetcode.com/problems/second-minimum-node-in-a-binary-tree |
| 38 | 76 | Minimum Window Substring | 34.6% | Hard | 1.5906343171159958 | https://leetcode.com/problems/minimum-window-substring |
| 39 | 464 | Can I Win | 28.8% | Medium | 1.506328285095676 | https://leetcode.com/problems/can-i-win |
| 40 | 236 | Lowest Common Ancestor of a Binary Tree | 45.7% | Medium | 1.4917287074839412 | https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree |
| 41 | 12 | Integer to Roman | 55.1% | Medium | 1.4878558960006285 | https://leetcode.com/problems/integer-to-roman |
| 42 | 373 | Find K Pairs with Smallest Sums | 36.7% | Medium | 1.4398887318809226 | https://leetcode.com/problems/find-k-pairs-with-smallest-sums |
| 43 | 235 | Lowest Common Ancestor of a Binary Search Tree | 49.9% | Easy | 1.4200618278990031 | https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree |
| 44 | 102 | Binary Tree Level Order Traversal | 54.6% | Medium | 1.4026563080569336 | https://leetcode.com/problems/binary-tree-level-order-traversal |
| 45 | 381 | Insert Delete GetRandom O(1) - Duplicates allowed | 34.1% | Hard | 1.4015377574600891 | https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed |
| 46 | 1 | Two Sum | 45.6% | Easy | 1.3998908606433091 | https://leetcode.com/problems/two-sum |
| 47 | 50 | Pow(x;n) | 30.3% | Medium | 1.295878904893276 | https://leetcode.com/problems/powx-n |
| 48 | 33 | Search in Rotated Sorted Array | 34.5% | Medium | 1.2373938135133047 | https://leetcode.com/problems/search-in-rotated-sorted-array |
| 49 | 20 | Valid Parentheses | 39.0% | Easy | 1.2333689145339155 | https://leetcode.com/problems/valid-parentheses |
| 50 | 273 | Integer to English Words | 27.1% | Hard | 1.2185425385498858 | https://leetcode.com/problems/integer-to-english-words |
| 51 | 34 | Find First and Last Position of Element in Sorted Array | 36.2% | Medium | 1.2091842728345334 | https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array |
| 52 | 127 | Word Ladder | 29.6% | Medium | 1.1879531176262481 | https://leetcode.com/problems/word-ladder |
| 53 | 57 | Insert Interval | 33.5% | Hard | 1.1730267742341929 | https://leetcode.com/problems/insert-interval |
| 54 | 636 | Exclusive Time of Functions | 51.9% | Medium | 1.1392005862073036 | https://leetcode.com/problems/exclusive-time-of-functions |
| 55 | 384 | Shuffle an Array | 52.8% | Medium | 0.991100943542345 | https://leetcode.com/problems/shuffle-an-array |
| 56 | 1117 | Building H2O | 52.6% | Medium | 0.9829600869737358 | https://leetcode.com/problems/building-h2o |
| 57 | 69 | Sqrt(x) | 33.9% | Easy | 0.9425416082510271 | https://leetcode.com/problems/sqrtx |
| 58 | 146 | LRU Cache | 33.2% | Medium | 0.9138670478439253 | https://leetcode.com/problems/lru-cache |
| 59 | 46 | Permutations | 63.5% | Medium | 0.8944850434890723 | https://leetcode.com/problems/permutations |
| 60 | 655 | Print Binary Tree | 55.0% | Medium | 0.8942200477548448 | https://leetcode.com/problems/print-binary-tree |
| 61 | 13 | Roman to Integer | 55.7% | Easy | 0.8933962612312258 | https://leetcode.com/problems/roman-to-integer |
| 62 | 744 | Find Smallest Letter Greater Than Target | 45.4% | Easy | 0.8539612853364241 | https://leetcode.com/problems/find-smallest-letter-greater-than-target |
| 63 | 215 | Kth Largest Element in an Array | 55.4% | Medium | 0.7561265689929935 | https://leetcode.com/problems/kth-largest-element-in-an-array |
| 64 | 449 | Serialize and Deserialize BST | 52.0% | Medium | 0.7481106198504164 | https://leetcode.com/problems/serialize-and-deserialize-bst |
| 65 | 715 | Range Module | 38.5% | Hard | 0.7472144018302211 | https://leetcode.com/problems/range-module |
| 66 | 296 | Best Meeting Point | 57.5% | Hard | 0.7267024804081622 | https://leetcode.com/problems/best-meeting-point |
| 67 | 1188 | Design Bounded Blocking Queue | 70.5% | Medium | 0.7176264446447249 | https://leetcode.com/problems/design-bounded-blocking-queue |
| 68 | 460 | LFU Cache | 34.2% | Hard | 0.668474221864485 | https://leetcode.com/problems/lfu-cache |
| 69 | 126 | Word Ladder II | 22.1% | Hard | 0.6364159003926323 | https://leetcode.com/problems/word-ladder-ii |
| 70 | 160 | Intersection of Two Linked Lists | 40.6% | Easy | 0.6045153022014824 | https://leetcode.com/problems/intersection-of-two-linked-lists |
| 71 | 101 | Symmetric Tree | 46.8% | Easy | 0.5986256023076202 | https://leetcode.com/problems/symmetric-tree |
| 72 | 879 | Profitable Schemes | 39.8% | Hard | 0.5560675878793254 | https://leetcode.com/problems/profitable-schemes |
| 73 | 47 | Permutations II | 46.4% | Medium | 0.5319853456599372 | https://leetcode.com/problems/permutations-ii |
| 74 | 104 | Maximum Depth of Binary Tree | 66.0% | Easy | 0.513251489692768 | https://leetcode.com/problems/maximum-depth-of-binary-tree |
| 75 | 706 | Design HashMap | 61.3% | Easy | 0.49262383645737706 | https://leetcode.com/problems/design-hashmap |
| 76 | 412 | Fizz Buzz | 62.3% | Easy | 0.4590212125771265 | https://leetcode.com/problems/fizz-buzz |
| 77 | 311 | Sparse Matrix Multiplication | 61.9% | Medium | 0.4503238876572249 | https://leetcode.com/problems/sparse-matrix-multiplication |
| 78 | 8 | String to Integer (atoi) | 15.4% | Medium | 0.407141925712164 | https://leetcode.com/problems/string-to-integer-atoi |
| 79 | 739 | Daily Temperatures | 63.3% | Medium | 0.40150804127350803 | https://leetcode.com/problems/daily-temperatures |
| 80 | 323 | Number of Connected Components in an Undirected Graph | 56.0% | Medium | 0.32984288327605893 | https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph |
| 81 | 367 | Valid Perfect Square | 41.7% | Easy | 0.3203744341373232 | https://leetcode.com/problems/valid-perfect-square |
| 82 | 61 | Rotate List | 30.0% | Medium | 0.3068243673566749 | https://leetcode.com/problems/rotate-list |
| 83 | 349 | Intersection of Two Arrays | 62.5% | Easy | 0.3049506996831345 | https://leetcode.com/problems/intersection-of-two-arrays |
| 84 | 23 | Merge k Sorted Lists | 40.2% | Hard | 0.28430175890527876 | https://leetcode.com/problems/merge-k-sorted-lists |
| 85 | 547 | Friend Circles | 58.6% | Medium | 0.2681916080548848 | https://leetcode.com/problems/friend-circles |
| 86 | 450 | Delete Node in a BST | 43.1% | Medium | 0.2618604317292985 | https://leetcode.com/problems/delete-node-in-a-bst |
| 87 | 470 | Implement Rand10() Using Rand7() | 46.3% | Medium | 0.2553466918088445 | https://leetcode.com/problems/implement-rand10-using-rand7 |
| 88 | 173 | Binary Search Tree Iterator | 56.6% | Medium | 0.22943234572951865 | https://leetcode.com/problems/binary-search-tree-iterator |
| 89 | 796 | Rotate String | 49.6% | Easy | 0.22026466797690847 | https://leetcode.com/problems/rotate-string |
| 90 | 528 | Random Pick with Weight | 43.9% | Medium | 0.21436399542669993 | https://leetcode.com/problems/random-pick-with-weight |
| 91 | 322 | Coin Change | 35.5% | Medium | 0.20468224088850068 | https://leetcode.com/problems/coin-change |
| 92 | 40 | Combination Sum II | 48.2% | Medium | 0.1780616138489939 | https://leetcode.com/problems/combination-sum-ii |
| 93 | 88 | Merge Sorted Array | 39.4% | Easy | 0.17642540243837188 | https://leetcode.com/problems/merge-sorted-array |
| 94 | 721 | Accounts Merge | 48.8% | Medium | 0.15836350116973763 | https://leetcode.com/problems/accounts-merge |
| 95 | 155 | Min Stack | 44.5% | Easy | 0.15817175770099312 | https://leetcode.com/problems/min-stack |
| 96 | 1148 | Article Views I | 75.8% | Easy | 0.15441568579144338 | https://leetcode.com/problems/article-views-i |
| 97 | 39 | Combination Sum | 56.1% | Medium | 0.1339254107186325 | https://leetcode.com/problems/combination-sum |
| 98 | 428 | Serialize and Deserialize N-ary Tree | 59.4% | Hard | 0.13313574474596881 | https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree |
| 99 | 54 | Spiral Matrix | 34.1% | Medium | 0.12572728493821236 | https://leetcode.com/problems/spiral-matrix |
| 100 | 1042 | Flower Planting With No Adjacent | 48.5% | Easy | 0.125457954276896 | https://leetcode.com/problems/flower-planting-with-no-adjacent |
| 101 | 21 | Merge Two Sorted Lists | 53.5% | Easy | 0.11955628018646022 | https://leetcode.com/problems/merge-two-sorted-lists |
| 102 | 75 | Sort Colors | 47.3% | Medium | 0.11789425180508288 | https://leetcode.com/problems/sort-colors |
| 103 | 103 | Binary Tree Zigzag Level Order Traversal | 48.3% | Medium | 0.11648551004070631 | https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal |
| 104 | 451 | Sort Characters By Frequency | 63.0% | Medium | 0.11258362132121401 | https://leetcode.com/problems/sort-characters-by-frequency |
| 105 | 973 | K Closest Points to Origin | 63.8% | Medium | 0.11087510283099485 | https://leetcode.com/problems/k-closest-points-to-origin |
| 106 | 198 | House Robber | 42.0% | Easy | 0.10785152815546674 | https://leetcode.com/problems/house-robber |
| 107 | 1028 | Recover a Tree From Preorder Traversal | 69.9% | Hard | 0.10734155493596446 | https://leetcode.com/problems/recover-a-tree-from-preorder-traversal |
| 108 | 238 | Product of Array Except Self | 60.1% | Medium | 0.09390398065367858 | https://leetcode.com/problems/product-of-array-except-self |
| 109 | 833 | Find And Replace in String | 50.4% | Medium | 0.08751937801655657 | https://leetcode.com/problems/find-and-replace-in-string |
| 110 | 100 | Same Tree | 53.4% | Easy | 0.08633894223670877 | https://leetcode.com/problems/same-tree |
| 111 | 350 | Intersection of Two Arrays II | 51.4% | Easy | 0.08027374155116185 | https://leetcode.com/problems/intersection-of-two-arrays-ii |
| 112 | 133 | Clone Graph | 34.8% | Medium | 0.07095173597228444 | https://leetcode.com/problems/clone-graph |
| 113 | 270 | Closest Binary Search Tree Value | 48.5% | Easy | 0.06680279511160087 | https://leetcode.com/problems/closest-binary-search-tree-value |
| 114 | 98 | Validate Binary Search Tree | 27.8% | Medium | 0.057985181512132535 | https://leetcode.com/problems/validate-binary-search-tree |
| 115 | 362 | Design Hit Counter | 63.7% | Medium | 0.05622967649867821 | https://leetcode.com/problems/design-hit-counter |
| 116 | 981 | Time Based Key-Value Store | 53.1% | Medium | 0.049406315387071284 | https://leetcode.com/problems/time-based-key-value-store |
| 117 | 121 | Best Time to Buy and Sell Stock | 50.5% | Easy | 0.04215422741819192 | https://leetcode.com/problems/best-time-to-buy-and-sell-stock |
| 118 | 647 | Palindromic Substrings | 60.6% | Medium | 0.040968350772541844 | https://leetcode.com/problems/palindromic-substrings |
| 119 | 141 | Linked List Cycle | 41.1% | Easy | 0.031012908394529512 | https://leetcode.com/problems/linked-list-cycle |
| 120 | 240 | Search a 2D Matrix II | 43.2% | Medium | 0.02999287612403949 | https://leetcode.com/problems/search-a-2d-matrix-ii |
| 121 | 692 | Top K Frequent Words | 51.8% | Medium | 0.029730915184679466 | https://leetcode.com/problems/top-k-frequent-words |
| 122 | 987 | Vertical Order Traversal of a Binary Tree | 36.6% | Medium | 0.025915645579833068 | https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree |
| 123 | 387 | First Unique Character in a String | 53.4% | Easy | 0.02587600384690711 | https://leetcode.com/problems/first-unique-character-in-a-string |
| 124 | 785 | Is Graph Bipartite? | 47.5% | Medium | 0.02510592113107633 | https://leetcode.com/problems/is-graph-bipartite |
| 125 | 70 | Climbing Stairs | 47.8% | Easy | 0.023866591309041507 | https://leetcode.com/problems/climbing-stairs |
| 126 | 113 | Path Sum II | 46.7% | Medium | 0.021882711249507664 | https://leetcode.com/problems/path-sum-ii |
| 127 | 359 | Logger Rate Limiter | 70.8% | Easy | 0.021053409197832343 | https://leetcode.com/problems/logger-rate-limiter |
| 128 | 207 | Course Schedule | 43.1% | Medium | 0.019709926055136454 | https://leetcode.com/problems/course-schedule |
| 129 | 347 | Top K Frequent Elements | 61.2% | Medium | 0.018049036874660983 | https://leetcode.com/problems/top-k-frequent-elements |
| 130 | 79 | Word Search | 35.6% | Medium | 0.014883688014740005 | https://leetcode.com/problems/word-search |
| 131 | 142 | Linked List Cycle II | 37.3% | Medium | 0.014710955064667802 | https://leetcode.com/problems/linked-list-cycle-ii |
| 132 | 560 | Subarray Sum Equals K | 43.9% | Medium | 0.009603146783199741 | https://leetcode.com/problems/subarray-sum-equals-k |
| 133 | 279 | Perfect Squares | 47.4% | Medium | 0.009216655104924008 | https://leetcode.com/problems/perfect-squares |
| 134 | 125 | Valid Palindrome | 36.7% | Easy | 0.008933948641551634 | https://leetcode.com/problems/valid-palindrome |
| 135 | 515 | Find Largest Value in Each Tree Row | 61.1% | Medium | 0 | https://leetcode.com/problems/find-largest-value-in-each-tree-row |
| 136 | 633 | Sum of Square Numbers | 32.2% | Easy | 0 | https://leetcode.com/problems/sum-of-square-numbers |
| 137 | 946 | Validate Stack Sequences | 61.9% | Medium | 0 | https://leetcode.com/problems/validate-stack-sequences |
| 138 | 1107 | New Users Daily Count | 45.1% | Medium | 0 | https://leetcode.com/problems/new-users-daily-count |
| 139 | 1127 | User Purchase Platform | 48.9% | Hard | 0 | https://leetcode.com/problems/user-purchase-platform |
| 140 | 1149 | Article Views II | 48.2% | Medium | 0 | https://leetcode.com/problems/article-views-ii |
| 141 | 1343 | Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold | 64.2% | Medium | 0 | https://leetcode.com/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold |