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

4.3 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2755Pour Water43.3%Medium4.694392422785564https://leetcode.com/problems/pour-water
3336Palindrome Pairs33.7%Hard4.005323090387116https://leetcode.com/problems/palindrome-pairs
4751IP to CIDR61.7%Medium3.3596034843633182https://leetcode.com/problems/ip-to-cidr
5251Flatten 2D Vector45.7%Medium2.6705341519648713https://leetcode.com/problems/flatten-2d-vector
6773Sliding Puzzle59.3%Hard2.143603485897122https://leetcode.com/problems/sliding-puzzle
7269Alien Dictionary33.3%Hard2.125834154172795https://leetcode.com/problems/alien-dictionary
81166Design File System56.8%Medium2.054985245702309https://leetcode.com/problems/design-file-system
9787Cheapest Flights Within K Stops39.3%Medium1.820249200959109https://leetcode.com/problems/cheapest-flights-within-k-stops
10166Fraction to Recurring Decimal21.6%Medium1.1768918457232653https://leetcode.com/problems/fraction-to-recurring-decimal
1139Combination Sum56.1%Medium0.8659171996195525https://leetcode.com/problems/combination-sum
12875Koko Eating Bananas52.1%Medium0.8409986269592165https://leetcode.com/problems/koko-eating-bananas
13759Employee Free Time66.2%Hard0.6974963641784472https://leetcode.com/problems/employee-free-time
14864Shortest Path to Get All Keys40.1%Hard0.6061358035703156https://leetcode.com/problems/shortest-path-to-get-all-keys
15324Wiggle Sort II29.9%Medium0.5511769192895581https://leetcode.com/problems/wiggle-sort-ii
16756Pyramid Transition Matrix54.6%Medium0.38776553100876343https://leetcode.com/problems/pyramid-transition-matrix
17341Flatten Nested List Iterator52.9%Medium0.3426517489923298https://leetcode.com/problems/flatten-nested-list-iterator
1868Text Justification27.7%Hard0.29518712556880805https://leetcode.com/problems/text-justification
191257Smallest Common Region58.8%Medium0.2561688067457042https://leetcode.com/problems/smallest-common-region
201235Maximum Profit in Job Scheduling44.0%Hard0.1532629744871177https://leetcode.com/problems/maximum-profit-in-job-scheduling
21322Coin Change35.5%Medium0.06260600694223208https://leetcode.com/problems/coin-change
22588Design In-Memory File System45.9%Hard0.05841076215641451https://leetcode.com/problems/design-in-memory-file-system
23843Guess the Word46.1%Hard0.045462374076757336https://leetcode.com/problems/guess-the-word
24280Wiggle Sort63.8%Medium0.04362742017962607https://leetcode.com/problems/wiggle-sort
2542Trapping Rain Water48.9%Hard0.02688623073425064https://leetcode.com/problems/trapping-rain-water
26622Design Circular Queue43.7%Medium0.02246023667974994https://leetcode.com/problems/design-circular-queue
27212Word Search II34.9%Hard0.02201654487096149https://leetcode.com/problems/word-search-ii
28236Lowest Common Ancestor of a Binary Tree45.7%Medium0.018724947332324816https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
291Two Sum45.6%Easy0.016487580637467636https://leetcode.com/problems/two-sum
30299Bulls and Cows42.4%Easy0.016227536621756702https://leetcode.com/problems/bulls-and-cows
31211Add and Search Word - Data structure design38.1%Medium0.010438508143923443https://leetcode.com/problems/add-and-search-word-data-structure-design
325Longest Palindromic Substring29.5%Medium0.009086325220960808https://leetcode.com/problems/longest-palindromic-substring
33953Verifying an Alien Dictionary54.1%Easy0.007884921592696038https://leetcode.com/problems/verifying-an-alien-dictionary
3476Minimum Window Substring34.6%Hard0.006231520398723243https://leetcode.com/problems/minimum-window-substring
3534Find 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
36215Kth Largest Element in an Array55.4%Medium0.003902443976931749https://leetcode.com/problems/kth-largest-element-in-an-array
374Median of Two Sorted Arrays29.6%Hard0.003900160950094767https://leetcode.com/problems/median-of-two-sorted-arrays
3821Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
392Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers