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)
```
11 KiB
11 KiB
| 1 | ID | Title | Acceptance | Difficulty | Frequency | Leetcode Question Link |
|---|---|---|---|---|---|---|
| 2 | 146 | LRU Cache | 33.2% | Medium | 0.1499900812285872 | https://leetcode.com/problems/lru-cache |
| 3 | 37 | Sudoku Solver | 43.6% | Hard | 0.13242170014920152 | https://leetcode.com/problems/sudoku-solver |
| 4 | 221 | Maximal Square | 37.7% | Medium | 0.11485331906981584 | https://leetcode.com/problems/maximal-square |
| 5 | 609 | Find Duplicate File in System | 59.5% | Medium | 0.09898183354885093 | https://leetcode.com/problems/find-duplicate-file-in-system |
| 6 | 20 | Valid Parentheses | 39.0% | Easy | 0.09286263438126167 | https://leetcode.com/problems/valid-parentheses |
| 7 | 1048 | Longest String Chain | 54.7% | Medium | 0.07529425330187599 | https://leetcode.com/problems/longest-string-chain |
| 8 | 49 | Group Anagrams | 56.9% | Medium | 0.07434615245733686 | https://leetcode.com/problems/group-anagrams |
| 9 | 697 | Degree of an Array | 53.8% | Easy | 0.07117627846789498 | https://leetcode.com/problems/degree-of-an-array |
| 10 | 460 | LFU Cache | 34.2% | Hard | 0.06836374280939023 | https://leetcode.com/problems/lfu-cache |
| 11 | 706 | Design HashMap | 61.3% | Easy | 0.0683442674369718 | https://leetcode.com/problems/design-hashmap |
| 12 | 1328 | Break a Palindrome | 43.3% | Medium | 0.05910139227591337 | https://leetcode.com/problems/break-a-palindrome |
| 13 | 829 | Consecutive Numbers Sum | 37.5% | Hard | 0.05341723749698583 | https://leetcode.com/problems/consecutive-numbers-sum |
| 14 | 85 | Maximal Rectangle | 37.7% | Hard | 0.05229949940284891 | https://leetcode.com/problems/maximal-rectangle |
| 15 | 186 | Reverse Words in a String II | 43.3% | Medium | 0.05064373281875492 | https://leetcode.com/problems/reverse-words-in-a-string-ii |
| 16 | 269 | Alien Dictionary | 33.3% | Hard | 0.04997917057465883 | https://leetcode.com/problems/alien-dictionary |
| 17 | 981 | Time Based Key-Value Store | 53.1% | Medium | 0.049406315387071284 | https://leetcode.com/problems/time-based-key-value-store |
| 18 | 322 | Coin Change | 35.5% | Medium | 0.04828048261319787 | https://leetcode.com/problems/coin-change |
| 19 | 698 | Partition to K Equal Sum Subsets | 45.0% | Medium | 0.04685917114094188 | https://leetcode.com/problems/partition-to-k-equal-sum-subsets |
| 20 | 556 | Next Greater Element III | 31.7% | Medium | 0.04679216150675895 | https://leetcode.com/problems/next-greater-element-iii |
| 21 | 97 | Interleaving String | 31.5% | Hard | 0.04548535439411653 | https://leetcode.com/problems/interleaving-string |
| 22 | 93 | Restore IP Addresses | 35.6% | Medium | 0.04393092922572675 | https://leetcode.com/problems/restore-ip-addresses |
| 23 | 56 | Merge Intervals | 39.3% | Medium | 0.04173304225331761 | https://leetcode.com/problems/merge-intervals |
| 24 | 243 | Shortest Word Distance | 61.0% | Easy | 0.040780370344928096 | https://leetcode.com/problems/shortest-word-distance |
| 25 | 380 | Insert Delete GetRandom O(1) | 47.5% | Medium | 0.038717635350707984 | https://leetcode.com/problems/insert-delete-getrandom-o1 |
| 26 | 47 | Permutations II | 46.4% | Medium | 0.038145268259690404 | https://leetcode.com/problems/permutations-ii |
| 27 | 905 | Sort Array By Parity | 74.1% | Easy | 0.03787434929243582 | https://leetcode.com/problems/sort-array-by-parity |
| 28 | 295 | Find Median from Data Stream | 44.3% | Hard | 0.035519827248535335 | https://leetcode.com/problems/find-median-from-data-stream |
| 29 | 277 | Find the Celebrity | 41.8% | Medium | 0.02969780239174205 | https://leetcode.com/problems/find-the-celebrity |
| 30 | 33 | Search in Rotated Sorted Array | 34.5% | Medium | 0.0287009496170278 | https://leetcode.com/problems/search-in-rotated-sorted-array |
| 31 | 733 | Flood Fill | 55.3% | Easy | 0.02506396866321625 | https://leetcode.com/problems/flood-fill |
| 32 | 23 | Merge k Sorted Lists | 40.2% | Hard | 0.0250564321052577 | https://leetcode.com/problems/merge-k-sorted-lists |
| 33 | 1 | Two Sum | 45.6% | Easy | 0.024530411623017775 | https://leetcode.com/problems/two-sum |
| 34 | 426 | Convert Binary Search Tree to Sorted Doubly Linked List | 59.1% | Medium | 0.024214258120594613 | https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list |
| 35 | 1209 | Remove All Adjacent Duplicates in String II | 56.9% | Medium | 0.02324334737232728 | https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii |
| 36 | 206 | Reverse Linked List | 62.5% | Easy | 0.02086427467076072 | https://leetcode.com/problems/reverse-linked-list |
| 37 | 341 | Flatten Nested List Iterator | 52.9% | Medium | 0.019980684690483426 | https://leetcode.com/problems/flatten-nested-list-iterator |
| 38 | 525 | Contiguous Array | 42.8% | Medium | 0.01975372873623256 | https://leetcode.com/problems/contiguous-array |
| 39 | 402 | Remove K Digits | 28.4% | Medium | 0.016863806052004816 | https://leetcode.com/problems/remove-k-digits |
| 40 | 116 | Populating Next Right Pointers in Each Node | 45.2% | Medium | 0.016432723251567683 | https://leetcode.com/problems/populating-next-right-pointers-in-each-node |
| 41 | 238 | Product of Array Except Self | 60.1% | Medium | 0.015629897160874744 | https://leetcode.com/problems/product-of-array-except-self |
| 42 | 4 | Median of Two Sorted Arrays | 29.6% | Hard | 0.015510198481701449 | https://leetcode.com/problems/median-of-two-sorted-arrays |
| 43 | 80 | Remove Duplicates from Sorted Array II | 44.0% | Medium | 0.014815085785140639 | https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii |
| 44 | 102 | Binary Tree Level Order Traversal | 54.6% | Medium | 0.014477270588287548 | https://leetcode.com/problems/binary-tree-level-order-traversal |
| 45 | 109 | Convert Sorted List to Binary Search Tree | 47.7% | Medium | 0.014440684154794336 | https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree |
| 46 | 150 | Evaluate Reverse Polish Notation | 36.3% | Medium | 0.01413451093490476 | https://leetcode.com/problems/evaluate-reverse-polish-notation |
| 47 | 3 | Longest Substring Without Repeating Characters | 30.4% | Medium | 0.01391434345649413 | https://leetcode.com/problems/longest-substring-without-repeating-characters |
| 48 | 304 | Range Sum Query 2D - Immutable | 38.6% | Medium | 0.013913267916985026 | https://leetcode.com/problems/range-sum-query-2d-immutable |
| 49 | 39 | Combination Sum | 56.1% | Medium | 0.012815211692867591 | https://leetcode.com/problems/combination-sum |
| 50 | 226 | Invert Binary Tree | 65.0% | Easy | 0.01235091863400913 | https://leetcode.com/problems/invert-binary-tree |
| 51 | 88 | Merge Sorted Array | 39.4% | Easy | 0.011986958032982505 | https://leetcode.com/problems/merge-sorted-array |
| 52 | 98 | Validate Binary Search Tree | 27.8% | Medium | 0.01172346369605921 | https://leetcode.com/problems/validate-binary-search-tree |
| 53 | 647 | Palindromic Substrings | 60.6% | Medium | 0.010400509768078022 | https://leetcode.com/problems/palindromic-substrings |
| 54 | 25 | Reverse Nodes in k-Group | 42.1% | Hard | 0.01021198560502829 | https://leetcode.com/problems/reverse-nodes-in-k-group |
| 55 | 72 | Edit Distance | 44.8% | Hard | 0.010017614452317782 | https://leetcode.com/problems/edit-distance |
| 56 | 17 | Letter Combinations of a Phone Number | 46.8% | Medium | 0.00987716546167603 | https://leetcode.com/problems/letter-combinations-of-a-phone-number |
| 57 | 113 | Path Sum II | 46.7% | Medium | 0.009784813879998279 | https://leetcode.com/problems/path-sum-ii |
| 58 | 21 | Merge Two Sorted Lists | 53.5% | Easy | 0.008990339814651234 | https://leetcode.com/problems/merge-two-sorted-lists |
| 59 | 215 | Kth Largest Element in an Array | 55.4% | Medium | 0.008759180089881562 | https://leetcode.com/problems/kth-largest-element-in-an-array |
| 60 | 977 | Squares of a Sorted Array | 72.1% | Easy | 0.008733679968754604 | https://leetcode.com/problems/squares-of-a-sorted-array |
| 61 | 63 | Unique Paths II | 34.6% | Medium | 0.008712753874961187 | https://leetcode.com/problems/unique-paths-ii |
| 62 | 416 | Partition Equal Subset Sum | 43.7% | Medium | 0.008686265255960345 | https://leetcode.com/problems/partition-equal-subset-sum |
| 63 | 8 | String to Integer (atoi) | 15.4% | Medium | 0.008513104762248265 | https://leetcode.com/problems/string-to-integer-atoi |
| 64 | 394 | Decode String | 50.0% | Medium | 0.008166644000272283 | https://leetcode.com/problems/decode-string |
| 65 | 133 | Clone Graph | 34.8% | Medium | 0.008136741393061732 | https://leetcode.com/problems/clone-graph |
| 66 | 239 | Sliding Window Maximum | 43.0% | Hard | 0.007898935224534491 | https://leetcode.com/problems/sliding-window-maximum |
| 67 | 16 | 3Sum Closest | 46.0% | Medium | 0.0075259057003469075 | https://leetcode.com/problems/3sum-closest |
| 68 | 692 | Top K Frequent Words | 51.8% | Medium | 0.007516006820935329 | https://leetcode.com/problems/top-k-frequent-words |
| 69 | 36 | Valid Sudoku | 48.7% | Medium | 0.007258242715805398 | https://leetcode.com/problems/valid-sudoku |
| 70 | 297 | Serialize and Deserialize Binary Tree | 47.5% | Hard | 0.007077170374085099 | https://leetcode.com/problems/serialize-and-deserialize-binary-tree |
| 71 | 2 | Add Two Numbers | 33.9% | Medium | 0.006737434951993369 | https://leetcode.com/problems/add-two-numbers |
| 72 | 200 | Number of Islands | 46.8% | Medium | 0.006490251382779317 | https://leetcode.com/problems/number-of-islands |
| 73 | 41 | First Missing Positive | 32.0% | Hard | 0.0064113058208121855 | https://leetcode.com/problems/first-missing-positive |
| 74 | 162 | Find Peak Element | 43.3% | Medium | 0.006350235659345837 | https://leetcode.com/problems/find-peak-element |
| 75 | 230 | Kth Smallest Element in a BST | 60.2% | Medium | 0.0063361529894967236 | https://leetcode.com/problems/kth-smallest-element-in-a-bst |
| 76 | 76 | Minimum Window Substring | 34.6% | Hard | 0.006231520398723243 | https://leetcode.com/problems/minimum-window-substring |
| 77 | 127 | Word Ladder | 29.6% | Medium | 0.005979091056058075 | https://leetcode.com/problems/word-ladder |
| 78 | 199 | Binary Tree Right Side View | 54.1% | Medium | 0.0056826406650506926 | https://leetcode.com/problems/binary-tree-right-side-view |
| 79 | 124 | Binary Tree Maximum Path Sum | 34.3% | Hard | 0.005531752454833179 | https://leetcode.com/problems/binary-tree-maximum-path-sum |
| 80 | 287 | Find the Duplicate Number | 55.5% | Medium | 0.005501320434837602 | https://leetcode.com/problems/find-the-duplicate-number |
| 81 | 300 | Longest Increasing Subsequence | 42.6% | Medium | 0.005264555460003242 | https://leetcode.com/problems/longest-increasing-subsequence |
| 82 | 55 | Jump Game | 34.6% | Medium | 0.005022612266291382 | https://leetcode.com/problems/jump-game |
| 83 | 75 | Sort Colors | 47.3% | Medium | 0.004992521603120986 | https://leetcode.com/problems/sort-colors |
| 84 | 15 | 3Sum | 26.8% | Medium | 0.004940992758742591 | https://leetcode.com/problems/3sum |
| 85 | 268 | Missing Number | 51.7% | Easy | 0.0048804391649084865 | https://leetcode.com/problems/missing-number |
| 86 | 62 | Unique Paths | 54.1% | Medium | 0.004621080312067025 | https://leetcode.com/problems/unique-paths |
| 87 | 234 | Palindrome Linked List | 39.3% | Easy | 0.004533613114828982 | https://leetcode.com/problems/palindrome-linked-list |
| 88 | 46 | Permutations | 63.5% | Medium | 0.004216302230139218 | https://leetcode.com/problems/permutations |
| 89 | 28 | Implement strStr() | 34.5% | Easy | 0.003943222775040032 | https://leetcode.com/problems/implement-strstr |
| 90 | 139 | Word Break | 40.1% | Medium | 0.003894465052690167 | https://leetcode.com/problems/word-break |
| 91 | 153 | Find Minimum in Rotated Sorted Array | 45.1% | Medium | 0.0037558729598054378 | https://leetcode.com/problems/find-minimum-in-rotated-sorted-array |
| 92 | 141 | Linked List Cycle | 41.1% | Easy | 0.0034937584669245472 | https://leetcode.com/problems/linked-list-cycle |
| 93 | 101 | Symmetric Tree | 46.8% | Easy | 0.0034057078469827435 | https://leetcode.com/problems/symmetric-tree |
| 94 | 347 | Top K Frequent Elements | 61.2% | Medium | 0.0033396446491217604 | https://leetcode.com/problems/top-k-frequent-elements |
| 95 | 19 | Remove Nth Node From End of List | 35.2% | Medium | 0.003076452203393495 | https://leetcode.com/problems/remove-nth-node-from-end-of-list |
| 96 | 11 | Container With Most Water | 50.8% | Medium | 0.0030677223230101427 | https://leetcode.com/problems/container-with-most-water |
| 97 | 621 | Task Scheduler | 50.1% | Medium | 0.002341784338144407 | https://leetcode.com/problems/task-scheduler |
| 98 | 5 | Longest Palindromic Substring | 29.5% | Medium | 0.002279333142507479 | https://leetcode.com/problems/longest-palindromic-substring |
| 99 | 121 | Best Time to Buy and Sell Stock | 50.5% | Easy | 0.0021239321954525975 | https://leetcode.com/problems/best-time-to-buy-and-sell-stock |
| 100 | 26 | Remove Duplicates from Sorted Array | 45.1% | Easy | 0.0019513153174351963 | https://leetcode.com/problems/remove-duplicates-from-sorted-array |
| 101 | 79 | Word Search | 35.6% | Medium | 0.0016647248725526849 | https://leetcode.com/problems/word-search |
| 102 | 151 | Reverse Words in a String | 21.9% | Medium | 0.0015375156780384337 | https://leetcode.com/problems/reverse-words-in-a-string |
| 103 | 50 | Pow(x;n) | 30.3% | Medium | 0.0014016892647828818 | https://leetcode.com/problems/powx-n |