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)
```
14 KiB
14 KiB
| 1 | ID | Title | Acceptance | Difficulty | Frequency | Leetcode Question Link |
|---|---|---|---|---|---|---|
| 2 | 364 | Nested List Weight Sum II | 62.8% | Medium | 3.4314026516185074 | https://leetcode.com/problems/nested-list-weight-sum-ii |
| 3 | 244 | Shortest Word Distance II | 52.3% | Medium | 3.3074402860776226 | https://leetcode.com/problems/shortest-word-distance-ii |
| 4 | 272 | Closest Binary Search Tree Value II | 50.5% | Hard | 3.009985507576158 | https://leetcode.com/problems/closest-binary-search-tree-value-ii |
| 5 | 716 | Max Stack | 42.6% | Easy | 2.8905651319656047 | https://leetcode.com/problems/max-stack |
| 6 | 366 | Find Leaves of Binary Tree | 70.6% | Medium | 2.719366575451067 | https://leetcode.com/problems/find-leaves-of-binary-tree |
| 7 | 170 | Two Sum III - Data structure design | 33.5% | Easy | 2.4219117969496025 | https://leetcode.com/problems/two-sum-iii-data-structure-design |
| 8 | 432 | All O`one Data Structure | 32.4% | Hard | 2.34464696026554 | https://leetcode.com/problems/all-oone-data-structure |
| 9 | 605 | Can Place Flowers | 31.6% | Easy | 2.300593060462805 | https://leetcode.com/problems/can-place-flowers |
| 10 | 339 | Nested List Weight Sum | 74.0% | Easy | 2.217225244042889 | https://leetcode.com/problems/nested-list-weight-sum |
| 11 | 254 | Factor Combinations | 46.7% | Medium | 2.157039260360306 | https://leetcode.com/problems/factor-combinations |
| 12 | 156 | Binary Tree Upside Down | 55.0% | Medium | 1.9388429818322208 | https://leetcode.com/problems/binary-tree-upside-down |
| 13 | 243 | Shortest Word Distance | 61.0% | Easy | 1.6413882033307563 | https://leetcode.com/problems/shortest-word-distance |
| 14 | 150 | Evaluate Reverse Polish Notation | 36.3% | Medium | 1.631958216745279 | https://leetcode.com/problems/evaluate-reverse-polish-notation |
| 15 | 256 | Paint House | 52.1% | Easy | 1.447627449136699 | https://leetcode.com/problems/paint-house |
| 16 | 68 | Text Justification | 27.7% | Hard | 1.2612363282688142 | https://leetcode.com/problems/text-justification |
| 17 | 149 | Max Points on a Line | 16.9% | Hard | 1.0358890301947536 | https://leetcode.com/problems/max-points-on-a-line |
| 18 | 698 | Partition to K Equal Sum Subsets | 45.0% | Medium | 1.0032310331325633 | https://leetcode.com/problems/partition-to-k-equal-sum-subsets |
| 19 | 730 | Count Different Palindromic Subsequences | 41.8% | Hard | 1.0003738490846965 | https://leetcode.com/problems/count-different-palindromic-subsequences |
| 20 | 65 | Valid Number | 15.3% | Hard | 0.98227329658396 | https://leetcode.com/problems/valid-number |
| 21 | 671 | Second Minimum Node In a Binary Tree | 42.7% | Easy | 0.904813710696626 | https://leetcode.com/problems/second-minimum-node-in-a-binary-tree |
| 22 | 380 | Insert Delete GetRandom O(1) | 47.5% | Medium | 0.8842506895781851 | https://leetcode.com/problems/insert-delete-getrandom-o1 |
| 23 | 265 | Paint House II | 44.6% | Hard | 0.8788156207076087 | https://leetcode.com/problems/paint-house-ii |
| 24 | 297 | Serialize and Deserialize Binary Tree | 47.5% | Hard | 0.7885864842588262 | https://leetcode.com/problems/serialize-and-deserialize-binary-tree |
| 25 | 373 | Find K Pairs with Smallest Sums | 36.7% | Medium | 0.7534978029618075 | https://leetcode.com/problems/find-k-pairs-with-smallest-sums |
| 26 | 235 | Lowest Common Ancestor of a Binary Search Tree | 49.9% | Easy | 0.6923217574837778 | https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree |
| 27 | 261 | Graph Valid Tree | 42.2% | Medium | 0.661701044953794 | https://leetcode.com/problems/graph-valid-tree |
| 28 | 76 | Minimum Window Substring | 34.6% | Hard | 0.641927908156958 | https://leetcode.com/problems/minimum-window-substring |
| 29 | 611 | Valid Triangle Number | 48.4% | Medium | 0.6315030174487386 | https://leetcode.com/problems/valid-triangle-number |
| 30 | 205 | Isomorphic Strings | 39.8% | Easy | 0.6091659093074805 | https://leetcode.com/problems/isomorphic-strings |
| 31 | 152 | Maximum Product Subarray | 31.7% | Medium | 0.5918273884045084 | https://leetcode.com/problems/maximum-product-subarray |
| 32 | 341 | Flatten Nested List Iterator | 52.9% | Medium | 0.5461187395622055 | https://leetcode.com/problems/flatten-nested-list-iterator |
| 33 | 53 | Maximum Subarray | 46.5% | Easy | 0.5323304442417232 | https://leetcode.com/problems/maximum-subarray |
| 34 | 57 | Insert Interval | 33.5% | Hard | 0.4990029568338001 | https://leetcode.com/problems/insert-interval |
| 35 | 636 | Exclusive Time of Functions | 51.9% | Medium | 0.49627524402791723 | https://leetcode.com/problems/exclusive-time-of-functions |
| 36 | 277 | Find the Celebrity | 41.8% | Medium | 0.47648222098694015 | https://leetcode.com/problems/find-the-celebrity |
| 37 | 127 | Word Ladder | 29.6% | Medium | 0.46981620538612967 | https://leetcode.com/problems/word-ladder |
| 38 | 72 | Edit Distance | 44.8% | Hard | 0.4487306287546189 | https://leetcode.com/problems/edit-distance |
| 39 | 1117 | Building H2O | 52.6% | Medium | 0.43571951646596674 | https://leetcode.com/problems/building-h2o |
| 40 | 706 | Design HashMap | 61.3% | Easy | 0.3660911265048934 | https://leetcode.com/problems/design-hashmap |
| 41 | 715 | Range Module | 38.5% | Hard | 0.33647223662121295 | https://leetcode.com/problems/range-module |
| 42 | 20 | Valid Parentheses | 39.0% | Easy | 0.32875969157833257 | https://leetcode.com/problems/valid-parentheses |
| 43 | 56 | Merge Intervals | 39.3% | Medium | 0.324649020144345 | https://leetcode.com/problems/merge-intervals |
| 44 | 236 | Lowest Common Ancestor of a Binary Tree | 45.7% | Medium | 0.32407608535777543 | https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree |
| 45 | 200 | Number of Islands | 46.8% | Medium | 0.3240548843543058 | https://leetcode.com/problems/number-of-islands |
| 46 | 381 | Insert Delete GetRandom O(1) - Duplicates allowed | 34.1% | Hard | 0.32306557634109756 | https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed |
| 47 | 273 | Integer to English Words | 27.1% | Hard | 0.3131081243495928 | https://leetcode.com/problems/integer-to-english-words |
| 48 | 879 | Profitable Schemes | 39.8% | Hard | 0.2856138193877219 | https://leetcode.com/problems/profitable-schemes |
| 49 | 102 | Binary Tree Level Order Traversal | 54.6% | Medium | 0.28444131830888175 | https://leetcode.com/problems/binary-tree-level-order-traversal |
| 50 | 47 | Permutations II | 46.4% | Medium | 0.2577738774664557 | https://leetcode.com/problems/permutations-ii |
| 51 | 470 | Implement Rand10() Using Rand7() | 46.3% | Medium | 0.2553466918088445 | https://leetcode.com/problems/implement-rand10-using-rand7 |
| 52 | 460 | LFU Cache | 34.2% | Hard | 0.24921579162398486 | https://leetcode.com/problems/lfu-cache |
| 53 | 215 | Kth Largest Element in an Array | 55.4% | Medium | 0.24881320355240788 | https://leetcode.com/problems/kth-largest-element-in-an-array |
| 54 | 655 | Print Binary Tree | 55.0% | Medium | 0.23545681154756673 | https://leetcode.com/problems/print-binary-tree |
| 55 | 1188 | Design Bounded Blocking Queue | 70.5% | Medium | 0.23300728083654992 | https://leetcode.com/problems/design-bounded-blocking-queue |
| 56 | 464 | Can I Win | 28.8% | Medium | 0.2228314901476892 | https://leetcode.com/problems/can-i-win |
| 57 | 516 | Longest Palindromic Subsequence | 53.2% | Medium | 0.2156692799855616 | https://leetcode.com/problems/longest-palindromic-subsequence |
| 58 | 33 | Search in Rotated Sorted Array | 34.5% | Medium | 0.21005273947217698 | https://leetcode.com/problems/search-in-rotated-sorted-array |
| 59 | 46 | Permutations | 63.5% | Medium | 0.18816690901782251 | https://leetcode.com/problems/permutations |
| 60 | 449 | Serialize and Deserialize BST | 52.0% | Medium | 0.1860058460684763 | https://leetcode.com/problems/serialize-and-deserialize-bst |
| 61 | 547 | Friend Circles | 58.6% | Medium | 0.17970355268064825 | https://leetcode.com/problems/friend-circles |
| 62 | 739 | Daily Temperatures | 63.3% | Medium | 0.14956674442158685 | https://leetcode.com/problems/daily-temperatures |
| 63 | 34 | Find First and Last Position of Element in Sorted Array | 36.2% | Medium | 0.14257571553993023 | https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array |
| 64 | 428 | Serialize and Deserialize N-ary Tree | 59.4% | Hard | 0.13313574474596881 | https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree |
| 65 | 367 | Valid Perfect Square | 41.7% | Easy | 0.1274707680128316 | https://leetcode.com/problems/valid-perfect-square |
| 66 | 50 | Pow(x;n) | 30.3% | Medium | 0.11919639741435266 | https://leetcode.com/problems/powx-n |
| 67 | 101 | Symmetric Tree | 46.8% | Easy | 0.11583847861592966 | https://leetcode.com/problems/symmetric-tree |
| 68 | 61 | Rotate List | 30.0% | Medium | 0.11528615545779625 | https://leetcode.com/problems/rotate-list |
| 69 | 721 | Accounts Merge | 48.8% | Medium | 0.11257939199174459 | https://leetcode.com/problems/accounts-merge |
| 70 | 296 | Best Meeting Point | 57.5% | Hard | 0.11216225709564905 | https://leetcode.com/problems/best-meeting-point |
| 71 | 349 | Intersection of Two Arrays | 62.5% | Easy | 0.11013353452843663 | https://leetcode.com/problems/intersection-of-two-arrays |
| 72 | 126 | Word Ladder II | 22.1% | Hard | 0.10749169745614619 | https://leetcode.com/problems/word-ladder-ii |
| 73 | 1028 | Recover a Tree From Preorder Traversal | 69.9% | Hard | 0.10734155493596446 | https://leetcode.com/problems/recover-a-tree-from-preorder-traversal |
| 74 | 744 | Find Smallest Letter Greater Than Target | 45.4% | Easy | 0.10446541455492596 | https://leetcode.com/problems/find-smallest-letter-greater-than-target |
| 75 | 796 | Rotate String | 49.6% | Easy | 0.10392210998497661 | https://leetcode.com/problems/rotate-string |
| 76 | 12 | Integer to Roman | 55.1% | Medium | 0.09981819303484349 | https://leetcode.com/problems/integer-to-roman |
| 77 | 69 | Sqrt(x) | 33.9% | Easy | 0.09855995053811686 | https://leetcode.com/problems/sqrtx |
| 78 | 104 | Maximum Depth of Binary Tree | 66.0% | Easy | 0.09576690509200843 | https://leetcode.com/problems/maximum-depth-of-binary-tree |
| 79 | 1 | Two Sum | 45.6% | Easy | 0.08664530282302181 | https://leetcode.com/problems/two-sum |
| 80 | 322 | Coin Change | 35.5% | Medium | 0.07859731751631634 | https://leetcode.com/problems/coin-change |
| 81 | 160 | Intersection of Two Linked Lists | 40.6% | Easy | 0.07567727378601781 | https://leetcode.com/problems/intersection-of-two-linked-lists |
| 82 | 88 | Merge Sorted Array | 39.4% | Easy | 0.0726641464118391 | https://leetcode.com/problems/merge-sorted-array |
| 83 | 1042 | Flower Planting With No Adjacent | 48.5% | Easy | 0.07249550203815351 | https://leetcode.com/problems/flower-planting-with-no-adjacent |
| 84 | 450 | Delete Node in a BST | 43.1% | Medium | 0.07216836682371046 | https://leetcode.com/problems/delete-node-in-a-bst |
| 85 | 1148 | Article Views I | 75.8% | Easy | 0.0715869066639981 | https://leetcode.com/problems/article-views-i |
| 86 | 187 | Repeated DNA Sequences | 38.9% | Medium | 0.06947237281476738 | https://leetcode.com/problems/repeated-dna-sequences |
| 87 | 323 | Number of Connected Components in an Undirected Graph | 56.0% | Medium | 0.06931179989022884 | https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph |
| 88 | 528 | Random Pick with Weight | 43.9% | Medium | 0.05805039128849884 | https://leetcode.com/problems/random-pick-with-weight |
| 89 | 13 | Roman to Integer | 55.7% | Easy | 0.05349762932680746 | https://leetcode.com/problems/roman-to-integer |
| 90 | 451 | Sort Characters By Frequency | 63.0% | Medium | 0.05160771036247213 | https://leetcode.com/problems/sort-characters-by-frequency |
| 91 | 39 | Combination Sum | 56.1% | Medium | 0.05030398316850793 | https://leetcode.com/problems/combination-sum |
| 92 | 412 | Fizz Buzz | 62.3% | Easy | 0.04396698989626337 | https://leetcode.com/problems/fizz-buzz |
| 93 | 146 | LRU Cache | 33.2% | Medium | 0.040660598211268925 | https://leetcode.com/problems/lru-cache |
| 94 | 833 | Find And Replace in String | 50.4% | Medium | 0.03984590854719967 | https://leetcode.com/problems/find-and-replace-in-string |
| 95 | 40 | Combination Sum II | 48.2% | Medium | 0.037775974158907266 | https://leetcode.com/problems/combination-sum-ii |
| 96 | 23 | Merge k Sorted Lists | 40.2% | Hard | 0.035885441255624394 | https://leetcode.com/problems/merge-k-sorted-lists |
| 97 | 103 | Binary Tree Zigzag Level Order Traversal | 48.3% | Medium | 0.03403976010989293 | https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal |
| 98 | 8 | String to Integer (atoi) | 15.4% | Medium | 0.03362603162985522 | https://leetcode.com/problems/string-to-integer-atoi |
| 99 | 173 | Binary Search Tree Iterator | 56.6% | Medium | 0.03353206029057467 | https://leetcode.com/problems/binary-search-tree-iterator |
| 100 | 75 | Sort Colors | 47.3% | Medium | 0.030801991570373215 | https://leetcode.com/problems/sort-colors |
| 101 | 362 | Design Hit Counter | 63.7% | Medium | 0.025382073271417165 | https://leetcode.com/problems/design-hit-counter |
| 102 | 785 | Is Graph Bipartite? | 47.5% | Medium | 0.02510592113107633 | https://leetcode.com/problems/is-graph-bipartite |
| 103 | 981 | Time Based Key-Value Store | 53.1% | Medium | 0.02226024024151985 | https://leetcode.com/problems/time-based-key-value-store |
| 104 | 359 | Logger Rate Limiter | 70.8% | Easy | 0.021053409197832343 | https://leetcode.com/problems/logger-rate-limiter |
| 105 | 350 | Intersection of Two Arrays II | 51.4% | Easy | 0.020680587107206983 | https://leetcode.com/problems/intersection-of-two-arrays-ii |
| 106 | 270 | Closest Binary Search Tree Value | 48.5% | Easy | 0.017123706078591462 | https://leetcode.com/problems/closest-binary-search-tree-value |
| 107 | 384 | Shuffle an Array | 52.8% | Medium | 0.015250009609723824 | https://leetcode.com/problems/shuffle-an-array |
| 108 | 54 | Spiral Matrix | 34.1% | Medium | 0.014776167707688753 | https://leetcode.com/problems/spiral-matrix |
| 109 | 973 | K Closest Points to Origin | 63.8% | Medium | 0.012944233661064114 | https://leetcode.com/problems/k-closest-points-to-origin |
| 110 | 987 | Vertical Order Traversal of a Binary Tree | 36.6% | Medium | 0.011601058182762062 | https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree |
| 111 | 207 | Course Schedule | 43.1% | Medium | 0.01113459480911671 | https://leetcode.com/problems/course-schedule |
| 112 | 113 | Path Sum II | 46.7% | Medium | 0.009784813879998279 | https://leetcode.com/problems/path-sum-ii |
| 113 | 279 | Perfect Squares | 47.4% | Medium | 0.009216655104924008 | https://leetcode.com/problems/perfect-squares |
| 114 | 198 | House Robber | 42.0% | Easy | 0.008434914115059812 | https://leetcode.com/problems/house-robber |
| 115 | 133 | Clone Graph | 34.8% | Medium | 0.008136741393061732 | https://leetcode.com/problems/clone-graph |
| 116 | 141 | Linked List Cycle | 41.1% | Easy | 0.007843861028908454 | https://leetcode.com/problems/linked-list-cycle |
| 117 | 240 | Search a 2D Matrix II | 43.2% | Medium | 0.0075829747244553335 | https://leetcode.com/problems/search-a-2d-matrix-ii |
| 118 | 692 | Top K Frequent Words | 51.8% | Medium | 0.007516006820935329 | https://leetcode.com/problems/top-k-frequent-words |
| 119 | 142 | Linked List Cycle II | 37.3% | Medium | 0.006564934131150057 | https://leetcode.com/problems/linked-list-cycle-ii |
| 120 | 21 | Merge Two Sorted Lists | 53.5% | Easy | 0.005067007800877041 | https://leetcode.com/problems/merge-two-sorted-lists |
| 121 | 155 | Min Stack | 44.5% | Easy | 0.00474891074128171 | https://leetcode.com/problems/min-stack |
| 122 | 560 | Subarray Sum Equals K | 43.9% | Medium | 0.004279454482267064 | https://leetcode.com/problems/subarray-sum-equals-k |
| 123 | 387 | First Unique Character in a String | 53.4% | Easy | 0.00418541994270691 | https://leetcode.com/problems/first-unique-character-in-a-string |
| 124 | 125 | Valid Palindrome | 36.7% | Easy | 0.0039805008274065926 | https://leetcode.com/problems/valid-palindrome |
| 125 | 100 | Same Tree | 53.4% | Easy | 0.003165227373565798 | https://leetcode.com/problems/same-tree |
| 126 | 98 | Validate Binary Search Tree | 27.8% | Medium | 0.002943776044013381 | https://leetcode.com/problems/validate-binary-search-tree |
| 127 | 121 | Best Time to Buy and Sell Stock | 50.5% | Easy | 0.0021239321954525975 | https://leetcode.com/problems/best-time-to-buy-and-sell-stock |
| 128 | 79 | Word Search | 35.6% | Medium | 0.0016647248725526849 | https://leetcode.com/problems/word-search |
| 129 | 70 | Climbing Stairs | 47.8% | Easy | 0.0015084665529624085 | https://leetcode.com/problems/climbing-stairs |
| 130 | 347 | Top K Frequent Elements | 61.2% | Medium | 0.0014856636219477439 | https://leetcode.com/problems/top-k-frequent-elements |