mirror of
https://github.com/McSmog/LeetCode-Questions-CompanyWise.git
synced 2026-04-19 08:46: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)
```
12 KiB
12 KiB
| 1 | ID | Title | Acceptance | Difficulty | Frequency | Leetcode Question Link |
|---|---|---|---|---|---|---|
| 2 | 42 | Trapping Rain Water | 48.9% | Hard | 2.020411699325411 | https://leetcode.com/problems/trapping-rain-water |
| 3 | 289 | Game of Life | 54.5% | Medium | 1.8133708003279605 | https://leetcode.com/problems/game-of-life |
| 4 | 1086 | High Five | 79.7% | Easy | 1.7830513754574853 | https://leetcode.com/problems/high-five |
| 5 | 209 | Minimum Size Subarray Sum | 38.2% | Medium | 1.576010476460035 | https://leetcode.com/problems/minimum-size-subarray-sum |
| 6 | 166 | Fraction to Recurring Decimal | 21.6% | Medium | 1.3689695774625845 | https://leetcode.com/problems/fraction-to-recurring-decimal |
| 7 | 722 | Remove Comments | 34.6% | Medium | 1.2012832402757514 | https://leetcode.com/problems/remove-comments |
| 8 | 4 | Median of Two Sorted Arrays | 29.6% | Hard | 1.1789254981240989 | https://leetcode.com/problems/median-of-two-sorted-arrays |
| 9 | 780 | Reaching Points | 29.4% | Hard | 1.0654848189471613 | https://leetcode.com/problems/reaching-points |
| 10 | 862 | Shortest Subarray with Sum at Least K | 24.6% | Hard | 1.0503043233346705 | https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k |
| 11 | 387 | First Unique Character in a String | 53.4% | Easy | 1.016175445916556 | https://leetcode.com/problems/first-unique-character-in-a-string |
| 12 | 688 | Knight Probability in Chessboard | 48.9% | Medium | 0.875792939010168 | https://leetcode.com/problems/knight-probability-in-chessboard |
| 13 | 706 | Design HashMap | 61.3% | Easy | 0.8231356111081237 | https://leetcode.com/problems/design-hashmap |
| 14 | 443 | String Compression | 41.3% | Easy | 0.8171356348259033 | https://leetcode.com/problems/string-compression |
| 15 | 1041 | Robot Bounded In Circle | 49.6% | Medium | 0.695004191307158 | https://leetcode.com/problems/robot-bounded-in-circle |
| 16 | 49 | Group Anagrams | 56.9% | Medium | 0.6192590691619644 | https://leetcode.com/problems/group-anagrams |
| 17 | 1163 | Last Substring in Lexicographical Order | 33.9% | Hard | 0.6115111972698513 | https://leetcode.com/problems/last-substring-in-lexicographical-order |
| 18 | 238 | Product of Array Except Self | 60.1% | Medium | 0.6032226884679701 | https://leetcode.com/problems/product-of-array-except-self |
| 19 | 592 | Fraction Addition and Subtraction | 49.0% | Medium | 0.5193002507569628 | https://leetcode.com/problems/fraction-addition-and-subtraction |
| 20 | 64 | Minimum Path Sum | 54.5% | Medium | 0.4040299464061684 | https://leetcode.com/problems/minimum-path-sum |
| 21 | 524 | Longest Word in Dictionary through Deleting | 48.4% | Medium | 0.3371083689581862 | https://leetcode.com/problems/longest-word-in-dictionary-through-deleting |
| 22 | 11 | Container With Most Water | 50.8% | Medium | 0.3160977539241027 | https://leetcode.com/problems/container-with-most-water |
| 23 | 121 | Best Time to Buy and Sell Stock | 50.5% | Easy | 0.3069889871822863 | https://leetcode.com/problems/best-time-to-buy-and-sell-stock |
| 24 | 657 | Robot Return to Origin | 73.5% | Easy | 0.2488586313688772 | https://leetcode.com/problems/robot-return-to-origin |
| 25 | 54 | Spiral Matrix | 34.1% | Medium | 0.2464878617937269 | https://leetcode.com/problems/spiral-matrix |
| 26 | 8 | String to Integer (atoi) | 15.4% | Medium | 0.1937032943399984 | https://leetcode.com/problems/string-to-integer-atoi |
| 27 | 153 | Find Minimum in Rotated Sorted Array | 45.1% | Medium | 0.16922265570239925 | https://leetcode.com/problems/find-minimum-in-rotated-sorted-array |
| 28 | 33 | Search in Rotated Sorted Array | 34.5% | Medium | 0.1671909490991562 | https://leetcode.com/problems/search-in-rotated-sorted-array |
| 29 | 532 | K-diff Pairs in an Array | 31.6% | Easy | 0.15718558352241233 | https://leetcode.com/problems/k-diff-pairs-in-an-array |
| 30 | 146 | LRU Cache | 33.2% | Medium | 0.1090999130829226 | https://leetcode.com/problems/lru-cache |
| 31 | 931 | Minimum Falling Path Sum | 62.5% | Medium | 0.10285229483975511 | https://leetcode.com/problems/minimum-falling-path-sum |
| 32 | 218 | The Skyline Problem | 34.6% | Hard | 0.09823843958341322 | https://leetcode.com/problems/the-skyline-problem |
| 33 | 322 | Coin Change | 35.5% | Medium | 0.09617246233782387 | https://leetcode.com/problems/coin-change |
| 34 | 720 | Longest Word in Dictionary | 48.2% | Easy | 0.09362342046209744 | https://leetcode.com/problems/longest-word-in-dictionary |
| 35 | 326 | Power of Three | 42.1% | Easy | 0.09026419332308504 | https://leetcode.com/problems/power-of-three |
| 36 | 942 | DI String Match | 72.6% | Easy | 0.08495672247596549 | https://leetcode.com/problems/di-string-match |
| 37 | 939 | Minimum Area Rectangle | 51.8% | Medium | 0.08361414004113359 | https://leetcode.com/problems/minimum-area-rectangle |
| 38 | 332 | Reconstruct Itinerary | 36.7% | Medium | 0.08302143328026106 | https://leetcode.com/problems/reconstruct-itinerary |
| 39 | 887 | Super Egg Drop | 27.1% | Hard | 0.08054440988796595 | https://leetcode.com/problems/super-egg-drop |
| 40 | 547 | Friend Circles | 58.6% | Medium | 0.07408600065076033 | https://leetcode.com/problems/friend-circles |
| 41 | 155 | Min Stack | 44.5% | Easy | 0.07340219281226193 | https://leetcode.com/problems/min-stack |
| 42 | 119 | Pascal's Triangle II | 49.0% | Easy | 0.07211890069342013 | https://leetcode.com/problems/pascals-triangle-ii |
| 43 | 1 | Two Sum | 45.6% | Easy | 0.07147453361485057 | https://leetcode.com/problems/two-sum |
| 44 | 200 | Number of Islands | 46.8% | Medium | 0.06985103785996453 | https://leetcode.com/problems/number-of-islands |
| 45 | 1051 | Height Checker | 71.1% | Easy | 0.06960783038095686 | https://leetcode.com/problems/height-checker |
| 46 | 141 | Linked List Cycle | 41.1% | Easy | 0.06847358948474051 | https://leetcode.com/problems/linked-list-cycle |
| 47 | 460 | LFU Cache | 34.2% | Hard | 0.06836374280939023 | https://leetcode.com/problems/lfu-cache |
| 48 | 588 | Design In-Memory File System | 45.9% | Hard | 0.05841076215641451 | https://leetcode.com/problems/design-in-memory-file-system |
| 49 | 1395 | Count Number of Teams | 82.0% | Medium | 0.056405927913552076 | https://leetcode.com/problems/count-number-of-teams |
| 50 | 62 | Unique Paths | 54.1% | Medium | 0.055187969852649885 | https://leetcode.com/problems/unique-paths |
| 51 | 76 | Minimum Window Substring | 34.6% | Hard | 0.05473322196089386 | https://leetcode.com/problems/minimum-window-substring |
| 52 | 724 | Find Pivot Index | 44.0% | Easy | 0.05428741283782842 | https://leetcode.com/problems/find-pivot-index |
| 53 | 44 | Wildcard Matching | 24.7% | Hard | 0.053722215229247965 | https://leetcode.com/problems/wildcard-matching |
| 54 | 91 | Decode Ways | 24.7% | Medium | 0.05247487679829598 | https://leetcode.com/problems/decode-ways |
| 55 | 99 | Recover Binary Search Tree | 39.7% | Hard | 0.051264071283762605 | https://leetcode.com/problems/recover-binary-search-tree |
| 56 | 560 | Subarray Sum Equals K | 43.9% | Medium | 0.0512021569656579 | https://leetcode.com/problems/subarray-sum-equals-k |
| 57 | 206 | Reverse Linked List | 62.5% | Easy | 0.046346967254127305 | https://leetcode.com/problems/reverse-linked-list |
| 58 | 78 | Subsets | 62.0% | Medium | 0.044263005655043326 | https://leetcode.com/problems/subsets |
| 59 | 1010 | Pairs of Songs With Total Durations Divisible by 60 | 47.4% | Easy | 0.04180336980436055 | https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60 |
| 60 | 56 | Merge Intervals | 39.3% | Medium | 0.04173304225331761 | https://leetcode.com/problems/merge-intervals |
| 61 | 118 | Pascal's Triangle | 52.5% | Easy | 0.041458432654901865 | https://leetcode.com/problems/pascals-triangle |
| 62 | 1219 | Path with Maximum Gold | 65.1% | Medium | 0.04111576039097048 | https://leetcode.com/problems/path-with-maximum-gold |
| 63 | 647 | Palindromic Substrings | 60.6% | Medium | 0.040968350772541844 | https://leetcode.com/problems/palindromic-substrings |
| 64 | 993 | Cousins in Binary Tree | 52.0% | Easy | 0.03876454345024432 | https://leetcode.com/problems/cousins-in-binary-tree |
| 65 | 317 | Shortest Distance from All Buildings | 41.4% | Hard | 0.03795522000043556 | https://leetcode.com/problems/shortest-distance-from-all-buildings |
| 66 | 992 | Subarrays with K Different Integers | 48.6% | Hard | 0.03700699810869683 | https://leetcode.com/problems/subarrays-with-k-different-integers |
| 67 | 122 | Best Time to Buy and Sell Stock II | 57.0% | Easy | 0.02979366347877695 | https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii |
| 68 | 19 | Remove Nth Node From End of List | 35.2% | Medium | 0.027353171676046843 | https://leetcode.com/problems/remove-nth-node-from-end-of-list |
| 69 | 836 | Rectangle Overlap | 48.6% | Easy | 0.024228925974379843 | https://leetcode.com/problems/rectangle-overlap |
| 70 | 215 | Kth Largest Element in an Array | 55.4% | Medium | 0.02414409892936099 | https://leetcode.com/problems/kth-largest-element-in-an-array |
| 71 | 1209 | Remove All Adjacent Duplicates in String II | 56.9% | Medium | 0.02324334737232728 | https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii |
| 72 | 380 | Insert Delete GetRandom O(1) | 47.5% | Medium | 0.021962815449093263 | https://leetcode.com/problems/insert-delete-getrandom-o1 |
| 73 | 167 | Two Sum II - Input array is sorted | 54.1% | Easy | 0.021849838247772296 | https://leetcode.com/problems/two-sum-ii-input-array-is-sorted |
| 74 | 53 | Maximum Subarray | 46.5% | Easy | 0.019336728821707075 | https://leetcode.com/problems/maximum-subarray |
| 75 | 3 | Longest Substring Without Repeating Characters | 30.4% | Medium | 0.018891763947827014 | https://leetcode.com/problems/longest-substring-without-repeating-characters |
| 76 | 876 | Middle of the Linked List | 68.4% | Easy | 0.01707497375257815 | https://leetcode.com/problems/middle-of-the-linked-list |
| 77 | 240 | Search a 2D Matrix II | 43.2% | Medium | 0.0169815401480941 | https://leetcode.com/problems/search-a-2d-matrix-ii |
| 78 | 16 | 3Sum Closest | 46.0% | Medium | 0.016854331554982106 | https://leetcode.com/problems/3sum-closest |
| 79 | 628 | Maximum Product of Three Numbers | 47.1% | Easy | 0.016529301951210565 | https://leetcode.com/problems/maximum-product-of-three-numbers |
| 80 | 120 | Triangle | 44.2% | Medium | 0.013236460625830901 | https://leetcode.com/problems/triangle |
| 81 | 445 | Add Two Numbers II | 54.5% | Medium | 0.01233061245747872 | https://leetcode.com/problems/add-two-numbers-ii |
| 82 | 98 | Validate Binary Search Tree | 27.8% | Medium | 0.01172346369605921 | https://leetcode.com/problems/validate-binary-search-tree |
| 83 | 283 | Move Zeroes | 57.8% | Easy | 0.01149190266804209 | https://leetcode.com/problems/move-zeroes |
| 84 | 207 | Course Schedule | 43.1% | Medium | 0.01113459480911671 | https://leetcode.com/problems/course-schedule |
| 85 | 739 | Daily Temperatures | 63.3% | Medium | 0.010032690121814417 | https://leetcode.com/problems/daily-temperatures |
| 86 | 72 | Edit Distance | 44.8% | Hard | 0.010017614452317782 | https://leetcode.com/problems/edit-distance |
| 87 | 17 | Letter Combinations of a Phone Number | 46.8% | Medium | 0.00987716546167603 | https://leetcode.com/problems/letter-combinations-of-a-phone-number |
| 88 | 70 | Climbing Stairs | 47.8% | Easy | 0.009390798483527519 | https://leetcode.com/problems/climbing-stairs |
| 89 | 242 | Valid Anagram | 56.9% | Easy | 0.009322628116274939 | https://leetcode.com/problems/valid-anagram |
| 90 | 20 | Valid Parentheses | 39.0% | Easy | 0.009170695326061695 | https://leetcode.com/problems/valid-parentheses |
| 91 | 189 | Rotate Array | 34.7% | Easy | 0.00904437880665999 | https://leetcode.com/problems/rotate-array |
| 92 | 295 | Find Median from Data Stream | 44.3% | Hard | 0.00899893586856953 | https://leetcode.com/problems/find-median-from-data-stream |
| 93 | 63 | Unique Paths II | 34.6% | Medium | 0.008712753874961187 | https://leetcode.com/problems/unique-paths-ii |
| 94 | 438 | Find All Anagrams in a String | 43.3% | Medium | 0.008126822460497498 | https://leetcode.com/problems/find-all-anagrams-in-a-string |
| 95 | 253 | Meeting Rooms II | 45.7% | Medium | 0.008079219870546493 | https://leetcode.com/problems/meeting-rooms-ii |
| 96 | 13 | Roman to Integer | 55.7% | Easy | 0.007698267425752388 | https://leetcode.com/problems/roman-to-integer |
| 97 | 204 | Count Primes | 31.5% | Easy | 0.007072165261362441 | https://leetcode.com/problems/count-primes |
| 98 | 973 | K Closest Points to Origin | 63.8% | Medium | 0.005773688094426333 | https://leetcode.com/problems/k-closest-points-to-origin |
| 99 | 39 | Combination Sum | 56.1% | Medium | 0.005715934396440999 | https://leetcode.com/problems/combination-sum |
| 100 | 50 | Pow(x;n) | 30.3% | Medium | 0.0055950070772402055 | https://leetcode.com/problems/powx-n |
| 101 | 237 | Delete Node in a Linked List | 63.8% | Easy | 0.005144705881237697 | https://leetcode.com/problems/delete-node-in-a-linked-list |
| 102 | 15 | 3Sum | 26.8% | Medium | 0.004940992758742591 | https://leetcode.com/problems/3sum |
| 103 | 160 | Intersection of Two Linked Lists | 40.6% | Easy | 0.004901369939720486 | https://leetcode.com/problems/intersection-of-two-linked-lists |
| 104 | 46 | Permutations | 63.5% | Medium | 0.004216302230139218 | https://leetcode.com/problems/permutations |
| 105 | 23 | Merge k Sorted Lists | 40.2% | Hard | 0.004051459000748015 | https://leetcode.com/problems/merge-k-sorted-lists |
| 106 | 198 | House Robber | 42.0% | Easy | 0.0037576371128333645 | https://leetcode.com/problems/house-robber |
| 107 | 344 | Reverse String | 68.5% | Easy | 0.003269579502519813 | https://leetcode.com/problems/reverse-string |
| 108 | 88 | Merge Sorted Array | 39.4% | Easy | 0.0030102370714243072 | https://leetcode.com/problems/merge-sorted-array |
| 109 | 104 | Maximum Depth of Binary Tree | 66.0% | Easy | 0.002787846801433134 | https://leetcode.com/problems/maximum-depth-of-binary-tree |
| 110 | 347 | Top K Frequent Elements | 61.2% | Medium | 0.0014856636219477439 | https://leetcode.com/problems/top-k-frequent-elements |