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

5.3 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
220Valid Parentheses39.0%Easy0.5285821270620421https://leetcode.com/problems/valid-parentheses
3974Subarray Sums Divisible by K48.9%Medium0.45026093827333574https://leetcode.com/problems/subarray-sums-divisible-by-k
473Set Matrix Zeroes43.1%Medium0.37193974948462943https://leetcode.com/problems/set-matrix-zeroes
51283Find the Smallest Divisor Given a Threshold47.6%Medium0.36508501240027386https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
6443String Compression41.3%Easy0.3002083322709612https://leetcode.com/problems/string-compression
733Search in Rotated Sorted Array34.5%Medium0.2561733762253273https://leetcode.com/problems/search-in-rotated-sorted-array
8295Find Median from Data Stream44.3%Hard0.24172686903184679https://leetcode.com/problems/find-median-from-data-stream
937Sudoku Solver43.6%Hard0.20309089276282075https://leetcode.com/problems/sudoku-solver
10451Sort Characters By Frequency63.0%Medium0.19214843173356422https://leetcode.com/problems/sort-characters-by-frequency
11200Number of Islands46.8%Medium0.18986549858506208https://leetcode.com/problems/number-of-islands
12713Subarray Product Less Than K39.1%Medium0.14543583198422752https://leetcode.com/problems/subarray-product-less-than-k
13973K Closest Points to Origin63.8%Medium0.1351947450239383https://leetcode.com/problems/k-closest-points-to-origin
14146LRU Cache33.2%Medium0.13057313078965735https://leetcode.com/problems/lru-cache
151Two Sum45.6%Easy0.1299229690633312https://leetcode.com/problems/two-sum
1688Merge Sorted Array39.4%Easy0.11989115268466984https://leetcode.com/problems/merge-sorted-array
1753Maximum Subarray46.5%Easy0.11514006965309906https://leetcode.com/problems/maximum-subarray
18240Search a 2D Matrix II43.2%Medium0.1149245296604198https://leetcode.com/problems/search-a-2d-matrix-ii
19297Serialize and Deserialize Binary Tree47.5%Hard0.10763066419236544https://leetcode.com/problems/serialize-and-deserialize-binary-tree
20121Best Time to Buy and Sell Stock50.5%Easy0.0991059463235541https://leetcode.com/problems/best-time-to-buy-and-sell-stock
21138Copy List with Random Pointer36.4%Medium0.09473133310488323https://leetcode.com/problems/copy-list-with-random-pointer
22884Uncommon Words from Two Sentences63.3%Easy0.07990051073053109https://leetcode.com/problems/uncommon-words-from-two-sentences
23198House Robber42.0%Easy0.05849085907372723https://leetcode.com/problems/house-robber
2443Multiply Strings33.9%Medium0.05583052804728052https://leetcode.com/problems/multiply-strings
25724Find Pivot Index44.0%Easy0.05428741283782842https://leetcode.com/problems/find-pivot-index
26253Meeting Rooms II45.7%Medium0.04945628059066218https://leetcode.com/problems/meeting-rooms-ii
27153Sum26.8%Medium0.04361391077370199https://leetcode.com/problems/3sum
28404Sum of Left Leaves50.9%Easy0.031187558856704493https://leetcode.com/problems/sum-of-left-leaves
29134Gas Station38.5%Medium0.030183377823098576https://leetcode.com/problems/gas-station
30692Top K Frequent Words51.8%Medium0.029730915184679466https://leetcode.com/problems/top-k-frequent-words
313Longest Substring Without Repeating Characters30.4%Medium0.024604324231039386https://leetcode.com/problems/longest-substring-without-repeating-characters
32127Word Ladder29.6%Medium0.023704813655166343https://leetcode.com/problems/word-ladder
33739Daily Temperatures63.3%Medium0.022433642692117093https://leetcode.com/problems/daily-temperatures
3496Unique Binary Search Trees52.9%Medium0.02067613283842731https://leetcode.com/problems/unique-binary-search-trees
35160Intersection of Two Linked Lists40.6%Easy0.019462966881057867https://leetcode.com/problems/intersection-of-two-linked-lists
36314Binary Tree Vertical Order Traversal45.3%Medium0.018010392274465332https://leetcode.com/problems/binary-tree-vertical-order-traversal
3791Decode Ways24.7%Medium0.013379120336324091https://leetcode.com/problems/decode-ways
38242Valid Anagram56.9%Easy0.009322628116274939https://leetcode.com/problems/valid-anagram
39215Kth Largest Element in an Array55.4%Medium0.008759180089881562https://leetcode.com/problems/kth-largest-element-in-an-array
40167Two Sum II - Input array is sorted54.1%Easy0.005507380022589096https://leetcode.com/problems/two-sum-ii-input-array-is-sorted
41560Subarray Sum Equals K43.9%Medium0.004279454482267064https://leetcode.com/problems/subarray-sum-equals-k
42102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
43611Valid Triangle Number48.4%Medium0https://leetcode.com/problems/valid-triangle-number
441101The Earliest Moment When Everyone Become Friends66.3%Medium0https://leetcode.com/problems/the-earliest-moment-when-everyone-become-friends
451151Minimum Swaps to Group All 1's Together59.3%Medium0https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together
461328Break a Palindrome43.3%Medium0https://leetcode.com/problems/break-a-palindrome
471451Rearrange Words in a Sentence54.8%Medium0https://leetcode.com/problems/rearrange-words-in-a-sentence
481492The kth Factor of n67.9%Medium0https://leetcode.com/problems/the-kth-factor-of-n