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

4.4 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2829Consecutive Numbers Sum37.5%Hard0.4198634169489928https://leetcode.com/problems/consecutive-numbers-sum
3761Special Binary String54.7%Hard0.3007541540191337https://leetcode.com/problems/special-binary-string
41353Maximum Number of Events That Can Be Attended30.5%Medium0.29912265485367395https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended
51Two Sum45.6%Easy0.18001339192381483https://leetcode.com/problems/two-sum
642Trapping Rain Water48.9%Hard0.16908117464136005https://leetcode.com/problems/trapping-rain-water
754Spiral Matrix34.1%Medium0.12572728493821236https://leetcode.com/problems/spiral-matrix
820Valid Parentheses39.0%Easy0.10693122823835342https://leetcode.com/problems/valid-parentheses
9735Asteroid Collision41.0%Medium0.09542395191890234https://leetcode.com/problems/asteroid-collision
10377Combination Sum IV45.3%Medium0.08101594376008861https://leetcode.com/problems/combination-sum-iv
11697Degree of an Array53.8%Easy0.07117627846789498https://leetcode.com/problems/degree-of-an-array
1298Validate Binary Search Tree27.8%Medium0.057985181512132535https://leetcode.com/problems/validate-binary-search-tree
13200Number of Islands46.8%Medium0.05694938541936198https://leetcode.com/problems/number-of-islands
14362Design Hit Counter63.7%Medium0.05622967649867821https://leetcode.com/problems/design-hit-counter
15253Meeting Rooms II45.7%Medium0.04945628059066218https://leetcode.com/problems/meeting-rooms-ii
161010Pairs of Songs With Total Durations Divisible by 6047.4%Easy0.04180336980436055https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60
1776Minimum Window Substring34.6%Hard0.038324739262994685https://leetcode.com/problems/minimum-window-substring
18238Product of Array Except Self60.1%Medium0.03482987258052727https://leetcode.com/problems/product-of-array-except-self
19153Sum26.8%Medium0.0346167609048592https://leetcode.com/problems/3sum
204Median of Two Sorted Arrays29.6%Hard0.034565653112280895https://leetcode.com/problems/median-of-two-sorted-arrays
21236Lowest Common Ancestor of a Binary Tree45.7%Medium0.029105663386885607https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
22146LRU Cache33.2%Medium0.028411001832779885https://leetcode.com/problems/lru-cache
23273Integer to English Words27.1%Hard0.026980053764546055https://leetcode.com/problems/integer-to-english-words
24322Coin Change35.5%Medium0.024924029676386045https://leetcode.com/problems/coin-change
25138Copy List with Random Pointer36.4%Medium0.02453734514188008https://leetcode.com/problems/copy-list-with-random-pointer
2649Group Anagrams56.9%Medium0.02354157682187747https://leetcode.com/problems/group-anagrams
2714Longest Common Prefix35.4%Easy0.02057347087022327https://leetcode.com/problems/longest-common-prefix
2853Maximum Subarray46.5%Easy0.019336728821707075https://leetcode.com/problems/maximum-subarray
29206Reverse Linked List62.5%Easy0.01453513961911317https://leetcode.com/problems/reverse-linked-list
3033Search in Rotated Sorted Array34.5%Medium0.012857779194289386https://leetcode.com/problems/search-in-rotated-sorted-array
31155Min Stack44.5%Easy0.010653509851791077https://leetcode.com/problems/min-stack
32380Insert Delete GetRandom O(1)47.5%Medium0.009820849864094454https://leetcode.com/problems/insert-delete-getrandom-o1
3334Find First and Last Position of Element in Sorted Array36.2%Medium0.009531951009811851https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
34121Best Time to Buy and Sell Stock50.5%Easy0.00846879565300311https://leetcode.com/problems/best-time-to-buy-and-sell-stock
3556Merge Intervals39.3%Medium0.007796972706004796https://leetcode.com/problems/merge-intervals
36973K Closest Points to Origin63.8%Medium0.005773688094426333https://leetcode.com/problems/k-closest-points-to-origin
3721Merge Two Sorted Lists53.5%Easy0.005067007800877041https://leetcode.com/problems/merge-two-sorted-lists
38101Symmetric Tree46.8%Easy0.0034057078469827435https://leetcode.com/problems/symmetric-tree
391025Divisor Game66.3%Easy0https://leetcode.com/problems/divisor-game
401389Create Target Array in the Given Order84.2%Easy0https://leetcode.com/problems/create-target-array-in-the-given-order