LeetCode-Questions-CompanyWise/snapchat_2year.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

7.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2527Word Abbreviation54.3%Hard0.4819143893795129https://leetcode.com/problems/word-abbreviation
3296Best Meeting Point57.5%Hard0.388507095744267https://leetcode.com/problems/best-meeting-point
4317Shortest Distance from All Buildings41.4%Hard0.29874253625209474https://leetcode.com/problems/shortest-distance-from-all-buildings
5146LRU Cache33.2%Medium0.23060841514873096https://leetcode.com/problems/lru-cache
6772Basic Calculator III41.3%Hard0.13720112151348504https://leetcode.com/problems/basic-calculator-iii
7332Reconstruct Itinerary36.7%Medium0.08302143328026106https://leetcode.com/problems/reconstruct-itinerary
8224Basic Calculator36.8%Hard0.0813456394539524https://leetcode.com/problems/basic-calculator
9632Smallest Range Covering Elements from K Lists52.4%Hard0.07082605256861242https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists
1068Text Justification27.7%Hard0.06116036187169583https://leetcode.com/problems/text-justification
11305Number of Islands II40.1%Hard0.06007812394328337https://leetcode.com/problems/number-of-islands-ii
12212Word Search II34.9%Hard0.05999879858378973https://leetcode.com/problems/word-search-ii
13839Similar String Groups38.6%Hard0.05480823649499502https://leetcode.com/problems/similar-string-groups
14282Expression Add Operators35.5%Hard0.049982640867735496https://leetcode.com/problems/expression-add-operators
15986Interval List Intersections67.3%Medium0.04703983015489417https://leetcode.com/problems/interval-list-intersections
16733Flood Fill55.3%Easy0.04413292021115189https://leetcode.com/problems/flood-fill
17642Design Search Autocomplete System44.7%Hard0.04334372921647208https://leetcode.com/problems/design-search-autocomplete-system
18716Max Stack42.6%Easy0.042695919196489414https://leetcode.com/problems/max-stack
1956Merge Intervals39.3%Medium0.04173304225331761https://leetcode.com/problems/merge-intervals
201031Maximum Sum of Two Non-Overlapping Subarrays57.9%Medium0.03711000965123125https://leetcode.com/problems/maximum-sum-of-two-non-overlapping-subarrays
21658Find K Closest Elements40.9%Medium0.03699558767659505https://leetcode.com/problems/find-k-closest-elements
22139Word Break40.1%Medium0.03451593709018879https://leetcode.com/problems/word-break
23480Sliding Window Median37.2%Hard0.03373001037669306https://leetcode.com/problems/sliding-window-median
2479Word Search35.6%Medium0.03318208821436187https://leetcode.com/problems/word-search
25253Meeting Rooms II45.7%Medium0.03193246767820989https://leetcode.com/problems/meeting-rooms-ii
261146Snapshot Array37.0%Medium0.0317991816929387https://leetcode.com/problems/snapshot-array
27460LFU Cache34.2%Hard0.030962225603966897https://leetcode.com/problems/lfu-cache
28311Sparse Matrix Multiplication61.9%Medium0.027702602549335792https://leetcode.com/problems/sparse-matrix-multiplication
29200Number of Islands46.8%Medium0.025712029212602353https://leetcode.com/problems/number-of-islands
30362Design Hit Counter63.7%Medium0.025382073271417165https://leetcode.com/problems/design-hit-counter
31310Minimum Height Trees32.3%Medium0.02446605215440636https://leetcode.com/problems/minimum-height-trees
32127Word Ladder29.6%Medium0.023704813655166343https://leetcode.com/problems/word-ladder
33295Find Median from Data Stream44.3%Hard0.0201349084090559https://leetcode.com/problems/find-median-from-data-stream
34341Flatten Nested List Iterator52.9%Medium0.019980684690483426https://leetcode.com/problems/flatten-nested-list-iterator
3542Trapping Rain Water48.9%Hard0.017290251352643615https://leetcode.com/problems/trapping-rain-water
36415Add Strings47.5%Easy0.016991158247219373https://leetcode.com/problems/add-strings
37340Longest Substring with At Most K Distinct Characters44.1%Hard0.016122880486563188https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters
3854Spiral Matrix34.1%Medium0.014776167707688753https://leetcode.com/problems/spiral-matrix
39653Two Sum IV - Input is a BST55.5%Easy0.014224990931347289https://leetcode.com/problems/two-sum-iv-input-is-a-bst
4076Minimum Window Substring34.6%Hard0.013966707481708198https://leetcode.com/problems/minimum-window-substring
41557Reverse Words in a String III69.8%Easy0.013731764001315941https://leetcode.com/problems/reverse-words-in-a-string-iii
42329Longest Increasing Path in a Matrix43.4%Hard0.013400535537482126https://leetcode.com/problems/longest-increasing-path-in-a-matrix
4391Decode Ways24.7%Medium0.013379120336324091https://leetcode.com/problems/decode-ways
4439Combination Sum56.1%Medium0.012815211692867591https://leetcode.com/problems/combination-sum
45227Basic Calculator II36.9%Medium0.01239941490503826https://leetcode.com/problems/basic-calculator-ii
46169Majority Element58.7%Easy0.010558521365115802https://leetcode.com/problems/majority-element
47234Palindrome Linked List39.3%Easy0.010171877938733932https://leetcode.com/problems/palindrome-linked-list
4822Generate Parentheses62.7%Medium0.009785877810632554https://leetcode.com/problems/generate-parentheses
4963Unique Paths II34.6%Medium0.008712753874961187https://leetcode.com/problems/unique-paths-ii
5049Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
51394Decode String50.0%Medium0.008166644000272283https://leetcode.com/problems/decode-string
5214Longest Common Prefix35.4%Easy0.00745530292090591https://leetcode.com/problems/longest-common-prefix
53297Serialize and Deserialize Binary Tree47.5%Hard0.007077170374085099https://leetcode.com/problems/serialize-and-deserialize-binary-tree
54155Min Stack44.5%Easy0.00474891074128171https://leetcode.com/problems/min-stack
5562Unique Paths54.1%Medium0.004621080312067025https://leetcode.com/problems/unique-paths
56560Subarray Sum Equals K43.9%Medium0.004279454482267064https://leetcode.com/problems/subarray-sum-equals-k
57242Valid Anagram56.9%Easy0.004154123743115972https://leetcode.com/problems/valid-anagram
58189Rotate Array34.7%Easy0.004029826126500844https://leetcode.com/problems/rotate-array
59238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
60215Kth Largest Element in an Array55.4%Medium0.003902443976931749https://leetcode.com/problems/kth-largest-element-in-an-array
61347Top K Frequent Elements61.2%Medium0.0033396446491217604https://leetcode.com/problems/top-k-frequent-elements
62344Reverse String68.5%Easy0.003269579502519813https://leetcode.com/problems/reverse-string
6333Search in Rotated Sorted Array34.5%Medium0.003229976968332634https://leetcode.com/problems/search-in-rotated-sorted-array
64140Word Break II32.6%Hard0.0027070942357783584https://leetcode.com/problems/word-break-ii
65153Sum26.8%Medium0.0021990113314367685https://leetcode.com/problems/3sum
66121Best Time to Buy and Sell Stock50.5%Easy0.0021239321954525975https://leetcode.com/problems/best-time-to-buy-and-sell-stock
67210Course Schedule II40.7%Medium0.0019086707135282834https://leetcode.com/problems/course-schedule-ii
681Two Sum45.6%Easy0.00184543512358731https://leetcode.com/problems/two-sum
693Longest Substring Without Repeating Characters30.4%Medium0.0015556336509412823https://leetcode.com/problems/longest-substring-without-repeating-characters