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)
```
12 KiB
12 KiB
| 1 | ID | Title | Acceptance | Difficulty | Frequency | Leetcode Question Link |
|---|---|---|---|---|---|---|
| 2 | 1 | Two Sum | 45.6% | Easy | 0.31908885342700277 | https://leetcode.com/problems/two-sum |
| 3 | 1168 | Optimize Water Distribution in a Village | 60.9% | Hard | 0.24224370139848353 | https://leetcode.com/problems/optimize-water-distribution-in-a-village |
| 4 | 146 | LRU Cache | 33.2% | Medium | 0.1653985493699643 | https://leetcode.com/problems/lru-cache |
| 5 | 384 | Shuffle an Array | 52.8% | Medium | 0.08855339734144506 | https://leetcode.com/problems/shuffle-an-array |
| 6 | 274 | H-Index | 36.1% | Medium | 0.07134562063669476 | https://leetcode.com/problems/h-index |
| 7 | 49 | Group Anagrams | 56.9% | Medium | 0.07114500702306482 | https://leetcode.com/problems/group-anagrams |
| 8 | 205 | Isomorphic Strings | 39.8% | Easy | 0.06695941113194995 | https://leetcode.com/problems/isomorphic-strings |
| 9 | 95 | Unique Binary Search Trees II | 40.6% | Medium | 0.06306265634386511 | https://leetcode.com/problems/unique-binary-search-trees-ii |
| 10 | 46 | Permutations | 63.5% | Medium | 0.06191532308097974 | https://leetcode.com/problems/permutations |
| 11 | 200 | Number of Islands | 46.8% | Medium | 0.05455898425043439 | https://leetcode.com/problems/number-of-islands |
| 12 | 362 | Design Hit Counter | 63.7% | Medium | 0.053905264836202435 | https://leetcode.com/problems/design-hit-counter |
| 13 | 162 | Find Peak Element | 43.3% | Medium | 0.05335388873490833 | https://leetcode.com/problems/find-peak-element |
| 14 | 5 | Longest Palindromic Substring | 29.5% | Medium | 0.05305439734187932 | https://leetcode.com/problems/longest-palindromic-substring |
| 15 | 21 | Merge Two Sorted Lists | 53.5% | Easy | 0.05260218626700228 | https://leetcode.com/problems/merge-two-sorted-lists |
| 16 | 295 | Find Median from Data Stream | 44.3% | Hard | 0.05187885241444921 | https://leetcode.com/problems/find-median-from-data-stream |
| 17 | 416 | Partition Equal Subset Sum | 43.7% | Medium | 0.05076201393711222 | https://leetcode.com/problems/partition-equal-subset-sum |
| 18 | 518 | Coin Change 2 | 50.2% | Medium | 0.04656063549394753 | https://leetcode.com/problems/coin-change-2 |
| 19 | 160 | Intersection of Two Linked Lists | 40.6% | Easy | 0.04146148896528119 | https://leetcode.com/problems/intersection-of-two-linked-lists |
| 20 | 503 | Next Greater Element II | 56.5% | Medium | 0.04029193172282132 | https://leetcode.com/problems/next-greater-element-ii |
| 21 | 2 | Add Two Numbers | 33.9% | Medium | 0.03972401383463557 | https://leetcode.com/problems/add-two-numbers |
| 22 | 72 | Edit Distance | 44.8% | Hard | 0.037749233217789446 | https://leetcode.com/problems/edit-distance |
| 23 | 23 | Merge k Sorted Lists | 40.2% | Hard | 0.034354523502108394 | https://leetcode.com/problems/merge-k-sorted-lists |
| 24 | 238 | Product of Array Except Self | 60.1% | Medium | 0.03331790689167717 | https://leetcode.com/problems/product-of-array-except-self |
| 25 | 567 | Permutation in String | 44.4% | Medium | 0.03164821095078173 | https://leetcode.com/problems/permutation-in-string |
| 26 | 222 | Count Complete Tree Nodes | 46.8% | Medium | 0.029882701600012697 | https://leetcode.com/problems/count-complete-tree-nodes |
| 27 | 131 | Palindrome Partitioning | 47.5% | Medium | 0.029539397513905316 | https://leetcode.com/problems/palindrome-partitioning |
| 28 | 75 | Sort Colors | 47.3% | Medium | 0.02953900967923939 | https://leetcode.com/problems/sort-colors |
| 29 | 13 | Roman to Integer | 55.7% | Easy | 0.029095312409715624 | https://leetcode.com/problems/roman-to-integer |
| 30 | 316 | Remove Duplicate Letters | 35.8% | Hard | 0.029071814821976905 | https://leetcode.com/problems/remove-duplicate-letters |
| 31 | 206 | Reverse Linked List | 62.5% | Easy | 0.027001860879524588 | https://leetcode.com/problems/reverse-linked-list |
| 32 | 11 | Container With Most Water | 50.8% | Medium | 0.026255883963365544 | https://leetcode.com/problems/container-with-most-water |
| 33 | 273 | Integer to English Words | 27.1% | Hard | 0.025767242936146868 | https://leetcode.com/problems/integer-to-english-words |
| 34 | 22 | Generate Parentheses | 62.7% | Medium | 0.025674032888177357 | https://leetcode.com/problems/generate-parentheses |
| 35 | 605 | Can Place Flowers | 31.6% | Easy | 0.023502844454782748 | https://leetcode.com/problems/can-place-flowers |
| 36 | 138 | Copy List with Random Pointer | 36.4% | Medium | 0.023379206277628954 | https://leetcode.com/problems/copy-list-with-random-pointer |
| 37 | 108 | Convert Sorted Array to Binary Search Tree | 57.9% | Easy | 0.021134058283968957 | https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree |
| 38 | 212 | Word Search II | 34.9% | Hard | 0.021038644146708085 | https://leetcode.com/problems/word-search-ii |
| 39 | 60 | Permutation Sequence | 38.4% | Hard | 0.019268418865877057 | https://leetcode.com/problems/permutation-sequence |
| 40 | 93 | Restore IP Addresses | 35.6% | Medium | 0.01885958774468238 | https://leetcode.com/problems/restore-ip-addresses |
| 41 | 669 | Trim a Binary Search Tree | 63.0% | Easy | 0.01838287060053348 | https://leetcode.com/problems/trim-a-binary-search-tree |
| 42 | 12 | Integer to Roman | 55.1% | Medium | 0.018163970627671163 | https://leetcode.com/problems/integer-to-roman |
| 43 | 450 | Delete Node in a BST | 43.1% | Medium | 0.017715255135256906 | https://leetcode.com/problems/delete-node-in-a-bst |
| 44 | 126 | Word Ladder II | 22.1% | Hard | 0.017264131849759706 | https://leetcode.com/problems/word-ladder-ii |
| 45 | 283 | Move Zeroes | 57.8% | Easy | 0.017117843516968597 | https://leetcode.com/problems/move-zeroes |
| 46 | 17 | Letter Combinations of a Phone Number | 46.8% | Medium | 0.016740294672744443 | https://leetcode.com/problems/letter-combinations-of-a-phone-number |
| 47 | 168 | Excel Sheet Column Title | 31.1% | Easy | 0.01664624371778361 | https://leetcode.com/problems/excel-sheet-column-title |
| 48 | 34 | Find First and Last Position of Element in Sorted Array | 36.2% | Medium | 0.016217667425614986 | https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array |
| 49 | 863 | All Nodes Distance K in Binary Tree | 55.4% | Medium | 0.0161554402222852 | https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree |
| 50 | 178 | Rank Scores | 45.8% | Medium | 0.01606460250380669 | https://leetcode.com/problems/rank-scores |
| 51 | 7 | Reverse Integer | 25.8% | Easy | 0.015930950253255746 | https://leetcode.com/problems/reverse-integer |
| 52 | 242 | Valid Anagram | 56.9% | Easy | 0.015812168558991563 | https://leetcode.com/problems/valid-anagram |
| 53 | 225 | Implement Stack using Queues | 45.1% | Easy | 0.015760767534495523 | https://leetcode.com/problems/implement-stack-using-queues |
| 54 | 771 | Jewels and Stones | 86.4% | Easy | 0.015520228759096881 | https://leetcode.com/problems/jewels-and-stones |
| 55 | 334 | Increasing Triplet Subsequence | 40.0% | Medium | 0.015444322427473612 | https://leetcode.com/problems/increasing-triplet-subsequence |
| 56 | 322 | Coin Change | 35.5% | Medium | 0.01536423539952715 | https://leetcode.com/problems/coin-change |
| 57 | 204 | Count Primes | 31.5% | Easy | 0.01514925454347171 | https://leetcode.com/problems/count-primes |
| 58 | 215 | Kth Largest Element in an Array | 55.4% | Medium | 0.014861874883289309 | https://leetcode.com/problems/kth-largest-element-in-an-array |
| 59 | 141 | Linked List Cycle | 41.1% | Easy | 0.013308023070176913 | https://leetcode.com/problems/linked-list-cycle |
| 60 | 347 | Top K Frequent Elements | 61.2% | Medium | 0.013133123243576152 | https://leetcode.com/problems/top-k-frequent-elements |
| 61 | 557 | Reverse Words in a String III | 69.8% | Easy | 0.01311494207782801 | https://leetcode.com/problems/reverse-words-in-a-string-iii |
| 62 | 15 | 3Sum | 26.8% | Medium | 0.012936791030719435 | https://leetcode.com/problems/3sum |
| 63 | 53 | Maximum Subarray | 46.5% | Easy | 0.012896082985676302 | https://leetcode.com/problems/maximum-subarray |
| 64 | 973 | K Closest Points to Origin | 63.8% | Medium | 0.012352613834765824 | https://leetcode.com/problems/k-closest-points-to-origin |
| 65 | 33 | Search in Rotated Sorted Array | 34.5% | Medium | 0.012342978578758374 | https://leetcode.com/problems/search-in-rotated-sorted-array |
| 66 | 77 | Combinations | 54.7% | Medium | 0.011908446770635425 | https://leetcode.com/problems/combinations |
| 67 | 445 | Add Two Numbers II | 54.5% | Medium | 0.011785640248472312 | https://leetcode.com/problems/add-two-numbers-ii |
| 68 | 378 | Kth Smallest Element in a Sorted Matrix | 54.3% | Medium | 0.011055944567589151 | https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix |
| 69 | 232 | Implement Queue using Stacks | 49.6% | Easy | 0.010770163342482653 | https://leetcode.com/problems/implement-queue-using-stacks |
| 70 | 207 | Course Schedule | 43.1% | Medium | 0.010625837876226181 | https://leetcode.com/problems/course-schedule |
| 71 | 169 | Majority Element | 58.7% | Easy | 0.01012609912610397 | https://leetcode.com/problems/majority-element |
| 72 | 746 | Min Cost Climbing Stairs | 50.3% | Easy | 0.00942958425029653 | https://leetcode.com/problems/min-cost-climbing-stairs |
| 73 | 18 | 4Sum | 33.7% | Medium | 0.009345862418237686 | https://leetcode.com/problems/4sum |
| 74 | 42 | Trapping Rain Water | 48.9% | Hard | 0.009245058144051103 | https://leetcode.com/problems/trapping-rain-water |
| 75 | 32 | Longest Valid Parentheses | 28.4% | Hard | 0.008806750006418186 | https://leetcode.com/problems/longest-valid-parentheses |
| 76 | 20 | Valid Parentheses | 39.0% | Easy | 0.008761898231759775 | https://leetcode.com/problems/valid-parentheses |
| 77 | 4 | Median of Two Sorted Arrays | 29.6% | Hard | 0.00834419823769013 | https://leetcode.com/problems/median-of-two-sorted-arrays |
| 78 | 394 | Decode String | 50.0% | Medium | 0.0077851697215559675 | https://leetcode.com/problems/decode-string |
| 79 | 175 | Combine Two Tables | 60.8% | Easy | 0.007374664691267215 | https://leetcode.com/problems/combine-two-tables |
| 80 | 240 | Search a 2D Matrix II | 43.2% | Medium | 0.007279377002901276 | https://leetcode.com/problems/search-a-2d-matrix-ii |
| 81 | 176 | Second Highest Salary | 31.6% | Easy | 0.007097261870761636 | https://leetcode.com/problems/second-highest-salary |
| 82 | 1108 | Defanging an IP Address | 87.5% | Easy | 0.0070151111959223245 | https://leetcode.com/problems/defanging-an-ip-address |
| 83 | 680 | Valid Palindrome II | 36.6% | Easy | 0.0069674554638543594 | https://leetcode.com/problems/valid-palindrome-ii |
| 84 | 509 | Fibonacci Number | 67.2% | Easy | 0.0068213088507380355 | https://leetcode.com/problems/fibonacci-number |
| 85 | 114 | Flatten Binary Tree to Linked List | 49.3% | Medium | 0.00661815784247808 | https://leetcode.com/problems/flatten-binary-tree-to-linked-list |
| 86 | 448 | Find All Numbers Disappeared in an Array | 55.9% | Easy | 0.006552029991300186 | https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array |
| 87 | 9 | Palindrome Number | 48.4% | Easy | 0.006530753927898854 | https://leetcode.com/problems/palindrome-number |
| 88 | 88 | Merge Sorted Array | 39.4% | Easy | 0.006480904084083141 | https://leetcode.com/problems/merge-sorted-array |
| 89 | 104 | Maximum Depth of Binary Tree | 66.0% | Easy | 0.006002018684998332 | https://leetcode.com/problems/maximum-depth-of-binary-tree |
| 90 | 3 | Longest Substring Without Repeating Characters | 30.4% | Medium | 0.005927699633275225 | https://leetcode.com/problems/longest-substring-without-repeating-characters |
| 91 | 76 | Minimum Window Substring | 34.6% | Hard | 0.005927699633275225 | https://leetcode.com/problems/minimum-window-substring |
| 92 | 78 | Subsets | 62.0% | Medium | 0.005864474528481365 | https://leetcode.com/problems/subsets |
| 93 | 105 | Construct Binary Tree from Preorder and Inorder Traversal | 48.8% | Medium | 0.005399581153465832 | https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal |
| 94 | 237 | Delete Node in a Linked List | 63.8% | Easy | 0.004902571407932664 | https://leetcode.com/problems/delete-node-in-a-linked-list |
| 95 | 260 | Single Number III | 64.3% | Medium | 0.004544085371366539 | https://leetcode.com/problems/single-number-iii |
| 96 | 236 | Lowest Common Ancestor of a Binary Tree | 45.7% | Medium | 0.004507557778555423 | https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree |
| 97 | 560 | Subarray Sum Equals K | 43.9% | Medium | 0.00407664649376343 | https://leetcode.com/problems/subarray-sum-equals-k |
| 98 | 387 | First Unique Character in a String | 53.4% | Easy | 0.003992021269537453 | https://leetcode.com/problems/first-unique-character-in-a-string |
| 99 | 103 | Binary Tree Zigzag Level Order Traversal | 48.3% | Medium | 0.0037942709938308134 | https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal |
| 100 | 28 | Implement strStr() | 34.5% | Easy | 0.0037760830292959675 | https://leetcode.com/problems/implement-strstr |
| 101 | 79 | Word Search | 35.6% | Medium | 0.003688528772102895 | https://leetcode.com/problems/word-search |
| 102 | 102 | Binary Tree Level Order Traversal | 54.6% | Medium | 0.0034812915925119536 | https://leetcode.com/problems/binary-tree-level-order-traversal |
| 103 | 56 | Merge Intervals | 39.3% | Medium | 0.0033129067901687907 | https://leetcode.com/problems/merge-intervals |
| 104 | 122 | Best Time to Buy and Sell Stock II | 57.0% | Easy | 0.0032333711784785267 | https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii |
| 105 | 98 | Validate Binary Search Tree | 27.8% | Medium | 0.00280761046364743 | https://leetcode.com/problems/validate-binary-search-tree |
| 106 | 121 | Best Time to Buy and Sell Stock | 50.5% | Easy | 0.0020383211296970956 | https://leetcode.com/problems/best-time-to-buy-and-sell-stock |