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

3.6 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2446Arithmetic Slices II - Subsequence32.7%Hard0.053390859053336806https://leetcode.com/problems/arithmetic-slices-ii-subsequence
31Two Sum45.6%Easy0.04514397697084252https://leetcode.com/problems/two-sum
4146LRU Cache33.2%Medium0.040660598211268925https://leetcode.com/problems/lru-cache
5992Subarrays with K Different Integers48.6%Hard0.03700699810869683https://leetcode.com/problems/subarrays-with-k-different-integers
6460LFU Cache34.2%Hard0.030962225603966897https://leetcode.com/problems/lfu-cache
7678Valid Parenthesis String31.0%Medium0.02271534352147261https://leetcode.com/problems/valid-parenthesis-string
853Maximum Subarray46.5%Easy0.019336728821707075https://leetcode.com/problems/maximum-subarray
933Search in Rotated Sorted Array34.5%Medium0.012857779194289386https://leetcode.com/problems/search-in-rotated-sorted-array
10152Maximum Product Subarray31.7%Medium0.012534983069696118https://leetcode.com/problems/maximum-product-subarray
112Add Two Numbers33.9%Medium0.010507388732168088https://leetcode.com/problems/add-two-numbers
1262Unique Paths54.1%Medium0.010367562048856941https://leetcode.com/problems/unique-paths
135Longest Palindromic Substring29.5%Medium0.009086325220960808https://leetcode.com/problems/longest-palindromic-substring
14153Sum26.8%Medium0.00876717944353383https://leetcode.com/problems/3sum
15215Kth Largest Element in an Array55.4%Medium0.008759180089881562https://leetcode.com/problems/kth-largest-element-in-an-array
16173Binary Search Tree Iterator56.6%Medium0.008489015324911316https://leetcode.com/problems/binary-search-tree-iterator
17394Decode String50.0%Medium0.008166644000272283https://leetcode.com/problems/decode-string
18239Sliding Window Maximum43.0%Hard0.007898935224534491https://leetcode.com/problems/sliding-window-maximum
1910Regular Expression Matching26.8%Hard0.0071865203293987245https://leetcode.com/problems/regular-expression-matching
20200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
213Longest Substring Without Repeating Characters30.4%Medium0.006208067119374334https://leetcode.com/problems/longest-substring-without-repeating-characters
22206Reverse Linked List62.5%Easy0.005257021452801617https://leetcode.com/problems/reverse-linked-list
23160Intersection of Two Linked Lists40.6%Easy0.004901369939720486https://leetcode.com/problems/intersection-of-two-linked-lists
24121Best Time to Buy and Sell Stock50.5%Easy0.0047725193990346675https://leetcode.com/problems/best-time-to-buy-and-sell-stock
2522Generate Parentheses62.7%Medium0.0043611059090124735https://leetcode.com/problems/generate-parentheses
2623Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
274Median of Two Sorted Arrays29.6%Hard0.003900160950094767https://leetcode.com/problems/median-of-two-sorted-arrays
2856Merge Intervals39.3%Medium0.0034728286335985107https://leetcode.com/problems/merge-intervals
29101Symmetric Tree46.8%Easy0.0034057078469827435https://leetcode.com/problems/symmetric-tree
3094Binary Tree Inorder Traversal63.3%Medium0.0033551449021403577https://leetcode.com/problems/binary-tree-inorder-traversal
3114Longest Common Prefix35.4%Easy0.003320331762984143https://leetcode.com/problems/longest-common-prefix
3221Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
3370Climbing Stairs47.8%Easy0.0015084665529624085https://leetcode.com/problems/climbing-stairs