Files
LeetCode-Questions-CompanyWise/airbnb_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

6.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2336Palindrome Pairs33.7%Hard5.9749009408191585https://leetcode.com/problems/palindrome-pairs
3755Pour Water43.3%Medium5.821525282662105https://leetcode.com/problems/pour-water
4751IP to CIDR61.7%Medium4.677479721248074https://leetcode.com/problems/ip-to-cidr
5251Flatten 2D Vector45.7%Medium4.501060978905473https://leetcode.com/problems/flatten-2d-vector
6269Alien Dictionary33.3%Hard3.3570154174914424https://leetcode.com/problems/alien-dictionary
768Text Justification27.7%Hard3.0293920300570387https://leetcode.com/problems/text-justification
81166Design File System56.8%Medium2.7214059922837657https://leetcode.com/problems/design-file-system
9787Cheapest Flights Within K Stops39.3%Medium2.66336088062552https://leetcode.com/problems/cheapest-flights-within-k-stops
10773Sliding Puzzle59.3%Hard2.4717685123505686https://leetcode.com/problems/sliding-puzzle
11341Flatten Nested List Iterator52.9%Medium1.766208769110585https://leetcode.com/problems/flatten-nested-list-iterator
12166Fraction to Recurring Decimal21.6%Medium1.6639068207955374https://leetcode.com/problems/fraction-to-recurring-decimal
1339Combination Sum56.1%Medium1.6445826005250566https://leetcode.com/problems/combination-sum
14324Wiggle Sort II29.9%Medium1.2959351403605768https://leetcode.com/problems/wiggle-sort-ii
15875Koko Eating Bananas52.1%Medium1.2072640854100087https://leetcode.com/problems/koko-eating-bananas
1642Trapping Rain Water48.9%Hard1.1037585327659545https://leetcode.com/problems/trapping-rain-water
171Two Sum45.6%Easy1.0889331084185998https://leetcode.com/problems/two-sum
181058Minimize Rounding Error to Meet Target41.7%Medium1.042653635020065https://leetcode.com/problems/minimize-rounding-error-to-meet-target
19759Employee Free Time66.2%Hard0.9190267116930299https://leetcode.com/problems/employee-free-time
20756Pyramid Transition Matrix54.6%Medium0.8397506547518208https://leetcode.com/problems/pyramid-transition-matrix
21864Shortest Path to Get All Keys40.1%Hard0.6061358035703156https://leetcode.com/problems/shortest-path-to-get-all-keys
221257Smallest Common Region58.8%Medium0.5049690916532777https://leetcode.com/problems/smallest-common-region
23843Guess the Word46.1%Hard0.45092748218492174https://leetcode.com/problems/guess-the-word
24212Word Search II34.9%Hard0.3492519632676119https://leetcode.com/problems/word-search-ii
25588Design In-Memory File System45.9%Hard0.31913702461966714https://leetcode.com/problems/design-in-memory-file-system
26322Coin Change35.5%Medium0.2559919879212256https://leetcode.com/problems/coin-change
272Add Two Numbers33.9%Medium0.2512393123206071https://leetcode.com/problems/add-two-numbers
2810Regular Expression Matching26.8%Hard0.23083119919105394https://leetcode.com/problems/regular-expression-matching
291235Maximum Profit in Job Scheduling44.0%Hard0.23015822831359434https://leetcode.com/problems/maximum-profit-in-job-scheduling
30299Bulls and Cows42.4%Easy0.1826623303532244https://leetcode.com/problems/bulls-and-cows
3176Minimum Window Substring34.6%Hard0.1731900290370625https://leetcode.com/problems/minimum-window-substring
32219Contains Duplicate II37.7%Easy0.14617994030648507https://leetcode.com/problems/contains-duplicate-ii
33385Mini Parser33.8%Medium0.13176927763112334https://leetcode.com/problems/mini-parser
34198House Robber42.0%Easy0.12709898426651453https://leetcode.com/problems/house-robber
355Longest Palindromic Substring29.5%Medium0.12076411655886263https://leetcode.com/problems/longest-palindromic-substring
36220Contains Duplicate III20.9%Medium0.09599691440839975https://leetcode.com/problems/contains-duplicate-iii
37280Wiggle Sort63.8%Medium0.09561417737468547https://leetcode.com/problems/wiggle-sort
38236Lowest Common Ancestor of a Binary Tree45.7%Medium0.07288369759447264https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
3920Valid Parentheses39.0%Easy0.06735240264428982https://leetcode.com/problems/valid-parentheses
404Median of Two Sorted Arrays29.6%Hard0.0606476084726819https://leetcode.com/problems/median-of-two-sorted-arrays
41160Intersection of Two Linked Lists40.6%Easy0.043270781043381126https://leetcode.com/problems/intersection-of-two-linked-lists
42202Happy Number50.4%Easy0.03853744444187023https://leetcode.com/problems/happy-number
4321Merge Two Sorted Lists53.5%Easy0.03548634253021285https://leetcode.com/problems/merge-two-sorted-lists
44136Single Number65.5%Easy0.03459819810553353https://leetcode.com/problems/single-number
45108Convert Sorted Array to Binary Search Tree57.9%Easy0.03421710570764629https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree
4623Merge k Sorted Lists40.2%Hard0.0250564321052577https://leetcode.com/problems/merge-k-sorted-lists
47215Kth Largest Element in an Array55.4%Medium0.02414409892936099https://leetcode.com/problems/kth-largest-element-in-an-array
48622Design Circular Queue43.7%Medium0.02246023667974994https://leetcode.com/problems/design-circular-queue
49221Maximal Square37.7%Medium0.022108490754203434https://leetcode.com/problems/maximal-square
50217Contains Duplicate56.0%Easy0.015106027431013205https://leetcode.com/problems/contains-duplicate
51211Add and Search Word - Data structure design38.1%Medium0.010438508143923443https://leetcode.com/problems/add-and-search-word-data-structure-design
52953Verifying an Alien Dictionary54.1%Easy0.007884921592696038https://leetcode.com/problems/verifying-an-alien-dictionary
53190Reverse Bits39.8%Easy0.007306635849167308https://leetcode.com/problems/reverse-bits
5434Find First and Last Position of Element in Sorted Array36.2%Medium0.004247643638268045https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
55227Basic Calculator II36.9%Medium0https://leetcode.com/problems/basic-calculator-ii
56415Add Strings47.5%Easy0https://leetcode.com/problems/add-strings
571017Convert to Base -259.0%Medium0https://leetcode.com/problems/convert-to-base-2
581041Robot Bounded In Circle49.6%Medium0https://leetcode.com/problems/robot-bounded-in-circle
591284Minimum Number of Flips to Convert Binary Matrix to Zero Matrix69.5%Hard0https://leetcode.com/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix
601298Maximum Candies You Can Get from Boxes58.8%Hard0https://leetcode.com/problems/maximum-candies-you-can-get-from-boxes