Files
LeetCode-Questions-CompanyWise/expedia_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.7 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2974Subarray Sums Divisible by K48.9%Medium0.23897880752617776https://leetcode.com/problems/subarray-sums-divisible-by-k
31283Find the Smallest Divisor Given a Threshold47.6%Medium0.17884755718277986https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
4443String Compression41.3%Easy0.11871630683938197https://leetcode.com/problems/string-compression
5713Subarray Product Less Than K39.1%Medium0.09548093997208476https://leetcode.com/problems/subarray-product-less-than-k
6973K Closest Points to Origin63.8%Medium0.08860246722187161https://leetcode.com/problems/k-closest-points-to-origin
7884Uncommon Words from Two Sentences63.3%Easy0.07990051073053109https://leetcode.com/problems/uncommon-words-from-two-sentences
833Search in Rotated Sorted Array34.5%Medium0.07777550022464022https://leetcode.com/problems/search-in-rotated-sorted-array
920Valid Parentheses39.0%Easy0.06735240264428982https://leetcode.com/problems/valid-parentheses
10146LRU Cache33.2%Medium0.040660598211268925https://leetcode.com/problems/lru-cache
11200Number of Islands46.8%Medium0.03483682053721545https://leetcode.com/problems/number-of-islands
12724Find Pivot Index44.0%Easy0.03089844155123413https://leetcode.com/problems/find-pivot-index
13451Sort Characters By Frequency63.0%Medium0.029356315510965035https://leetcode.com/problems/sort-characters-by-frequency
14297Serialize and Deserialize Binary Tree47.5%Hard0.028013036227673965https://leetcode.com/problems/serialize-and-deserialize-binary-tree
15295Find Median from Data Stream44.3%Hard0.0201349084090559https://leetcode.com/problems/find-median-from-data-stream
1637Sudoku Solver43.6%Hard0.01821543989134118https://leetcode.com/problems/sudoku-solver
17314Binary Tree Vertical Order Traversal45.3%Medium0.018010392274465332https://leetcode.com/problems/binary-tree-vertical-order-traversal
18692Top K Frequent Words51.8%Medium0.016832265743172113https://leetcode.com/problems/top-k-frequent-words
1973Set Matrix Zeroes43.1%Medium0.015715357479628243https://leetcode.com/problems/set-matrix-zeroes
20198House Robber42.0%Easy0.014946565030639177https://leetcode.com/problems/house-robber
21404Sum of Left Leaves50.9%Easy0.013981353230340547https://leetcode.com/problems/sum-of-left-leaves
22138Copy List with Random Pointer36.4%Medium0.013876263355766411https://leetcode.com/problems/copy-list-with-random-pointer
23134Gas Station38.5%Medium0.01352742981715631https://leetcode.com/problems/gas-station
2488Merge Sorted Array39.4%Easy0.011986958032982505https://leetcode.com/problems/merge-sorted-array
25160Intersection of Two Linked Lists40.6%Easy0.010994491398666248https://leetcode.com/problems/intersection-of-two-linked-lists
26739Daily Temperatures63.3%Medium0.010032690121814417https://leetcode.com/problems/daily-temperatures
271Two Sum45.6%Easy0.010006414028595919https://leetcode.com/problems/two-sum
28242Valid Anagram56.9%Easy0.009322628116274939https://leetcode.com/problems/valid-anagram
2996Unique Binary Search Trees52.9%Medium0.009242209964820877https://leetcode.com/problems/unique-binary-search-trees
3043Multiply Strings33.9%Medium0.009145011150062768https://leetcode.com/problems/multiply-strings
3153Maximum Subarray46.5%Easy0.008640295679602939https://leetcode.com/problems/maximum-subarray
32121Best Time to Buy and Sell Stock50.5%Easy0.00846879565300311https://leetcode.com/problems/best-time-to-buy-and-sell-stock
33253Meeting Rooms II45.7%Medium0.008079219870546493https://leetcode.com/problems/meeting-rooms-ii
34240Search a 2D Matrix II43.2%Medium0.0075829747244553335https://leetcode.com/problems/search-a-2d-matrix-ii
353Longest Substring Without Repeating Characters30.4%Medium0.006208067119374334https://leetcode.com/problems/longest-substring-without-repeating-characters
36127Word Ladder29.6%Medium0.005979091056058075https://leetcode.com/problems/word-ladder
3791Decode Ways24.7%Medium0.005968385368349129https://leetcode.com/problems/decode-ways
38167Two Sum II - Input array is sorted54.1%Easy0.005507380022589096https://leetcode.com/problems/two-sum-ii-input-array-is-sorted
39560Subarray Sum Equals K43.9%Medium0.004279454482267064https://leetcode.com/problems/subarray-sum-equals-k
40215Kth Largest Element in an Array55.4%Medium0.003902443976931749https://leetcode.com/problems/kth-largest-element-in-an-array
41102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
42153Sum26.8%Medium0.0021990113314367685https://leetcode.com/problems/3sum