Files
LeetCode-Questions-CompanyWise/yahoo_alltime.csv
Krishna Kumar Dey fb5f78b55e Chore: Add headers to all the files (#54)
## 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)

```
2023-04-01 11:07:49 +05:30

13 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21Two Sum45.6%Easy1.0504031269795928https://leetcode.com/problems/two-sum
3146LRU Cache33.2%Medium0.926846943318982https://leetcode.com/problems/lru-cache
4479Largest Palindrome Product29.0%Hard0.8032907596583713https://leetcode.com/problems/largest-palindrome-product
521Merge Two Sorted Lists53.5%Easy0.7853099973687983https://leetcode.com/problems/merge-two-sorted-lists
64Median of Two Sorted Arrays29.6%Hard0.7610346403858894https://leetcode.com/problems/median-of-two-sorted-arrays
72Add Two Numbers33.9%Medium0.6795404182689078https://leetcode.com/problems/add-two-numbers
85Longest Palindromic Substring29.5%Medium0.6502013445328179https://leetcode.com/problems/longest-palindromic-substring
913Roman to Integer55.7%Easy0.6096336377374073https://leetcode.com/problems/roman-to-integer
10384Shuffle an Array52.8%Medium0.4860774540767966https://leetcode.com/problems/shuffle-an-array
11387First Unique Character in a String53.4%Easy0.48550781578170077https://leetcode.com/problems/first-unique-character-in-a-string
1223Merge k Sorted Lists40.2%Hard0.44418781328302553https://leetcode.com/problems/merge-k-sorted-lists
13238Product of Array Except Self60.1%Medium0.40402106453593073https://leetcode.com/problems/product-of-array-except-self
14205Isomorphic Strings39.8%Easy0.3839990482132866https://leetcode.com/problems/isomorphic-strings
15295Find Median from Data Stream44.3%Hard0.34887033918684873https://leetcode.com/problems/find-median-from-data-stream
163Longest Substring Without Repeating Characters30.4%Medium0.32244532172494345https://leetcode.com/problems/longest-substring-without-repeating-characters
17153Sum26.8%Medium0.3218570242502425https://leetcode.com/problems/3sum
18206Reverse Linked List62.5%Easy0.32033584826897005https://leetcode.com/problems/reverse-linked-list
19139Word Break40.1%Medium0.2923270241489888https://leetcode.com/problems/word-break
20322Coin Change35.5%Medium0.2727167684165738https://leetcode.com/problems/coin-change
2175Sort Colors47.3%Medium0.26772773680232625https://leetcode.com/problems/sort-colors
227Reverse Integer25.8%Easy0.2635507930508001https://leetcode.com/problems/reverse-integer
2312Integer to Roman55.1%Medium0.25718087109817106https://leetcode.com/problems/integer-to-roman
241168Optimize Water Distribution in a Village60.9%Hard0.24664152258151367https://leetcode.com/problems/optimize-water-distribution-in-a-village
25200Number of Islands46.8%Medium0.2444449971304404https://leetcode.com/problems/number-of-islands
26175Combine Two Tables60.8%Easy0.23623293593199463https://leetcode.com/problems/combine-two-tables
2722Generate Parentheses62.7%Medium0.23610403534378016https://leetcode.com/problems/generate-parentheses
2820Valid Parentheses39.0%Easy0.23602975009962368https://leetcode.com/problems/valid-parentheses
2949Group Anagrams56.9%Medium0.23355795379592467https://leetcode.com/problems/group-anagrams
3095Unique Binary Search Trees II40.6%Medium0.23140873085083383https://leetcode.com/problems/unique-binary-search-trees-ii
31121Best Time to Buy and Sell Stock50.5%Easy0.220651159985368https://leetcode.com/problems/best-time-to-buy-and-sell-stock
32204Count Primes31.5%Easy0.21851958006712824https://leetcode.com/problems/count-primes
33212Word Search II34.9%Hard0.21207376585128412https://leetcode.com/problems/word-search-ii
34273Integer to English Words27.1%Hard0.21100521366984107https://leetcode.com/problems/integer-to-english-words
3553Maximum Subarray46.5%Easy0.20616834410216844https://leetcode.com/problems/maximum-subarray
36362Design Hit Counter63.7%Medium0.20011109835745294https://leetcode.com/problems/design-hit-counter
37236Lowest Common Ancestor of a Binary Tree45.7%Medium0.19997225664986382https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
38240Search a 2D Matrix II43.2%Medium0.199673934851342https://leetcode.com/problems/search-a-2d-matrix-ii
39160Intersection of Two Linked Lists40.6%Easy0.18126267087820316https://leetcode.com/problems/intersection-of-two-linked-lists
4046Permutations63.5%Medium0.17865549703058456https://leetcode.com/problems/permutations
41316Remove Duplicate Letters35.8%Hard0.1692074260063661https://leetcode.com/problems/remove-duplicate-letters
42102Binary Tree Level Order Traversal54.6%Medium0.15775607939386688https://leetcode.com/problems/binary-tree-level-order-traversal
43297Serialize and Deserialize Binary Tree47.5%Hard0.15573832539420163https://leetcode.com/problems/serialize-and-deserialize-binary-tree
44669Trim a Binary Search Tree63.0%Easy0.15441568579144338https://leetcode.com/problems/trim-a-binary-search-tree
45141Linked List Cycle41.1%Easy0.15195931150111644https://leetcode.com/problems/linked-list-cycle
4656Merge Intervals39.3%Medium0.1506602748874898https://leetcode.com/problems/merge-intervals
47215Kth Largest Element in an Array55.4%Medium0.1468246397351854https://leetcode.com/problems/kth-largest-element-in-an-array
48283Move Zeroes57.8%Easy0.1444351280411623https://leetcode.com/problems/move-zeroes
4933Search in Rotated Sorted Array34.5%Medium0.1416197608332402https://leetcode.com/problems/search-in-rotated-sorted-array
5017Letter Combinations of a Phone Number46.8%Medium0.1414394798141693https://leetcode.com/problems/letter-combinations-of-a-phone-number
5177Combinations54.7%Medium0.13693231153364https://leetcode.com/problems/combinations
529Palindrome Number48.4%Easy0.13338577922783287https://leetcode.com/problems/palindrome-number
53169Majority Element58.7%Easy0.12824491182968498https://leetcode.com/problems/majority-element
54274H-Index36.1%Medium0.12351840574112768https://leetcode.com/problems/h-index
55217Contains Duplicate56.0%Easy0.12305339234280654https://leetcode.com/problems/contains-duplicate
5642Trapping Rain Water48.9%Hard0.11766836333242314https://leetcode.com/problems/trapping-rain-water
5734Find First and Last Position of Element in Sorted Array36.2%Medium0.11657877743606745https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
58162Find Peak Element43.3%Medium0.1162765141658937https://leetcode.com/problems/find-peak-element
59284Peeking Iterator45.7%Medium0.11490387370472609https://leetcode.com/problems/peeking-iterator
60138Copy List with Random Pointer36.4%Medium0.11310689844326921https://leetcode.com/problems/copy-list-with-random-pointer
6193Restore IP Addresses35.6%Medium0.11242734769506908https://leetcode.com/problems/restore-ip-addresses
6279Word Search35.6%Medium0.11213285077655567https://leetcode.com/problems/word-search
63184Sum33.7%Medium0.10887545776527079https://leetcode.com/problems/4sum
64503Next Greater Element II56.5%Medium0.10814330069305735https://leetcode.com/problems/next-greater-element-ii
65450Delete Node in a BST43.1%Medium0.10589656498719952https://leetcode.com/problems/delete-node-in-a-bst
66108Convert Sorted Array to Binary Search Tree57.9%Easy0.10267368950715268https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree
67347Top K Frequent Elements61.2%Medium0.10086304939869323https://leetcode.com/problems/top-k-frequent-elements
68168Excel Sheet Column Title31.1%Easy0.09976368239756728https://leetcode.com/problems/excel-sheet-column-title
69605Can Place Flowers31.6%Easy0.09086837628235879https://leetcode.com/problems/can-place-flowers
7011Container With Most Water50.8%Medium0.08564331184863502https://leetcode.com/problems/container-with-most-water
7172Edit Distance44.8%Hard0.08301606966836801https://leetcode.com/problems/edit-distance
72771Jewels and Stones86.4%Easy0.08172573752382946https://leetcode.com/problems/jewels-and-stones
73131Palindrome Partitioning47.5%Medium0.07999145847429394https://leetcode.com/problems/palindrome-partitioning
74104Maximum Depth of Binary Tree66.0%Easy0.07782775325625388https://leetcode.com/problems/maximum-depth-of-binary-tree
75242Valid Anagram56.9%Easy0.0775954021309241https://leetcode.com/problems/valid-anagram
76237Delete Node in a Linked List63.8%Easy0.0756951835991673https://leetcode.com/problems/delete-node-in-a-linked-list
77416Partition Equal Subset Sum43.7%Medium0.07230612961778679https://leetcode.com/problems/partition-equal-subset-sum
78518Coin Change 250.2%Medium0.07182868392350407https://leetcode.com/problems/coin-change-2
7976Minimum Window Substring34.6%Hard0.0702999835499499https://leetcode.com/problems/minimum-window-substring
8088Merge Sorted Array39.4%Easy0.0697535511282702https://leetcode.com/problems/merge-sorted-array
81394Decode String50.0%Medium0.06797633310328935https://leetcode.com/problems/decode-string
8298Validate Binary Search Tree27.8%Medium0.06792860018956545https://leetcode.com/problems/validate-binary-search-tree
83126Word Ladder II22.1%Hard0.06733716983208086https://leetcode.com/problems/word-ladder-ii
84378Kth Smallest Element in a Sorted Matrix54.3%Medium0.0671753972751187https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix
85105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.06421700221172061https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
86225Implement Stack using Queues45.1%Easy0.06160531164682534https://leetcode.com/problems/implement-stack-using-queues
87334Increasing Triplet Subsequence40.0%Medium0.06039571028973993https://leetcode.com/problems/increasing-triplet-subsequence
88207Course Schedule43.1%Medium0.05653177507667831https://leetcode.com/problems/course-schedule
89567Permutation in String44.4%Medium0.055589162884756134https://leetcode.com/problems/permutation-in-string
9032Longest Valid Parentheses28.4%Hard0.053811130379891575https://leetcode.com/problems/longest-valid-parentheses
91445Add Two Numbers II54.5%Medium0.046331389773728096https://leetcode.com/problems/add-two-numbers-ii
9228Implement strStr()34.5%Easy0.045302625302384346https://leetcode.com/problems/implement-strstr
93122Best Time to Buy and Sell Stock II57.0%Easy0.03890614539325958https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
94560Subarray Sum Equals K43.9%Medium0.03610500464211627https://leetcode.com/problems/subarray-sum-equals-k
9578Subsets62.0%Medium0.03610109392687382https://leetcode.com/problems/subsets
96222Count Complete Tree Nodes46.8%Medium0.029882701600012697https://leetcode.com/problems/count-complete-tree-nodes
97176Second Highest Salary31.6%Easy0.02809173486701511https://leetcode.com/problems/second-highest-salary
98680Valid Palindrome II36.6%Easy0.027583200191427217https://leetcode.com/problems/valid-palindrome-ii
99114Flatten Binary Tree to Linked List49.3%Medium0.026213820787528385https://leetcode.com/problems/flatten-binary-tree-to-linked-list
100448Find All Numbers Disappeared in an Array55.9%Easy0.025954417138050502https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array
101232Implement Queue using Stacks49.6%Easy0.024071769412583627https://leetcode.com/problems/implement-queue-using-stacks
102973K Closest Points to Origin63.8%Medium0.021855807808645634https://leetcode.com/problems/k-closest-points-to-origin
103746Min Cost Climbing Stairs50.3%Easy0.021092884180567165https://leetcode.com/problems/min-cost-climbing-stairs
10460Permutation Sequence38.4%Hard0.019268418865877057https://leetcode.com/problems/permutation-sequence
105863All Nodes Distance K in Binary Tree55.4%Medium0.0161554402222852https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree
106178Rank Scores45.8%Medium0.01606460250380669https://leetcode.com/problems/rank-scores
1071108Defanging an IP Address87.5%Easy0.015715357479628243https://leetcode.com/problems/defanging-an-ip-address
108509Fibonacci Number67.2%Easy0.015283027980177014https://leetcode.com/problems/fibonacci-number
109557Reverse Words in a String III69.8%Easy0.01311494207782801https://leetcode.com/problems/reverse-words-in-a-string-iii
110260Single Number III64.3%Medium0.012571824032760881https://leetcode.com/problems/single-number-iii
111103Binary Tree Zigzag Level Order Traversal48.3%Medium0.006735449584647053https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
112491Increasing Subsequences46.1%Medium0https://leetcode.com/problems/increasing-subsequences
113624Maximum Distance in Arrays38.9%Easy0https://leetcode.com/problems/maximum-distance-in-arrays
114693Binary Number with Alternating Bits59.4%Easy0https://leetcode.com/problems/binary-number-with-alternating-bits
1151030Matrix Cells in Distance Order65.6%Easy0https://leetcode.com/problems/matrix-cells-in-distance-order