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

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2829Consecutive Numbers Sum37.5%Hard0.534071766545536https://leetcode.com/problems/consecutive-numbers-sum
3761Special Binary String54.7%Hard0.3007541540191337https://leetcode.com/problems/special-binary-string
442Trapping Rain Water48.9%Hard0.0674365414927314https://leetcode.com/problems/trapping-rain-water
5362Design Hit Counter63.7%Medium0.05622967649867821https://leetcode.com/problems/design-hit-counter
6735Asteroid Collision41.0%Medium0.05479154882968245https://leetcode.com/problems/asteroid-collision
71353Maximum Number of Events That Can Be Attended30.5%Medium0.05428741283782842https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended
81010Pairs of Songs With Total Durations Divisible by 6047.4%Easy0.04180336980436055https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60
9697Degree of an Array53.8%Easy0.03226086221822144https://leetcode.com/problems/degree-of-an-array
101Two Sum45.6%Easy0.02912591612409083https://leetcode.com/problems/two-sum
11153Sum26.8%Medium0.02661031301111795https://leetcode.com/problems/3sum
1298Validate Binary Search Tree27.8%Medium0.026187123416340663https://leetcode.com/problems/validate-binary-search-tree
13377Combination Sum IV45.3%Medium0.02087758502155521https://leetcode.com/problems/combination-sum-iv
14253Meeting Rooms II45.7%Medium0.018087309810579388https://leetcode.com/problems/meeting-rooms-ii
1554Spiral Matrix34.1%Medium0.014776167707688753https://leetcode.com/problems/spiral-matrix
1676Minimum Window Substring34.6%Hard0.013966707481708198https://leetcode.com/problems/minimum-window-substring
17273Integer to English Words27.1%Hard0.012081089250339716https://leetcode.com/problems/integer-to-english-words
18236Lowest Common Ancestor of a Binary Tree45.7%Medium0.010575891759058162https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
19380Insert Delete GetRandom O(1)47.5%Medium0.009820849864094454https://leetcode.com/problems/insert-delete-getrandom-o1
20322Coin Change35.5%Medium0.00904437880665999https://leetcode.com/problems/coin-change
21238Product of Array Except Self60.1%Medium0.008821856860216758https://leetcode.com/problems/product-of-array-except-self
224Median of Two Sorted Arrays29.6%Hard0.008754068159914991https://leetcode.com/problems/median-of-two-sorted-arrays
2349Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
2433Search in Rotated Sorted Array34.5%Medium0.007252832180390353https://leetcode.com/problems/search-in-rotated-sorted-array
25200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
26138Copy List with Random Pointer36.4%Medium0.006191011880825271https://leetcode.com/problems/copy-list-with-random-pointer
27973K Closest Points to Origin63.8%Medium0.005773688094426333https://leetcode.com/problems/k-closest-points-to-origin
28206Reverse Linked List62.5%Easy0.005257021452801617https://leetcode.com/problems/reverse-linked-list
29121Best Time to Buy and Sell Stock50.5%Easy0.0047725193990346675https://leetcode.com/problems/best-time-to-buy-and-sell-stock
30155Min Stack44.5%Easy0.00474891074128171https://leetcode.com/problems/min-stack
31146LRU Cache33.2%Medium0.004600353139061353https://leetcode.com/problems/lru-cache
3234Find 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
3356Merge Intervals39.3%Medium0.0034728286335985107https://leetcode.com/problems/merge-intervals
34101Symmetric Tree46.8%Easy0.0034057078469827435https://leetcode.com/problems/symmetric-tree
3514Longest Common Prefix35.4%Easy0.003320331762984143https://leetcode.com/problems/longest-common-prefix
3620Valid Parentheses39.0%Easy0.0023005704055949323https://leetcode.com/problems/valid-parentheses
3721Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
3853Maximum Subarray46.5%Easy0.002167082872150794https://leetcode.com/problems/maximum-subarray