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

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21349Maximum Students Taking Exam42.0%Hard0.12179424958237695https://leetcode.com/problems/maximum-students-taking-exam
3738Monotone Increasing Digits44.3%Medium0.08479653666007693https://leetcode.com/problems/monotone-increasing-digits
41283Find the Smallest Divisor Given a Threshold47.6%Medium0.047798823737776906https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
51Two Sum45.6%Easy0.02912591612409083https://leetcode.com/problems/two-sum
6917Reverse Only Letters58.0%Easy0.0286552557603761https://leetcode.com/problems/reverse-only-letters
7283Move Zeroes57.8%Easy0.025673520193393074https://leetcode.com/problems/move-zeroes
8559Maximum Depth of N-ary Tree68.7%Easy0.024524389863084386https://leetcode.com/problems/maximum-depth-of-n-ary-tree
91048Longest String Chain54.7%Medium0.019361689049145963https://leetcode.com/problems/longest-string-chain
10146LRU Cache33.2%Medium0.01827577993873683https://leetcode.com/problems/lru-cache
11509Fibonacci Number67.2%Easy0.01593518138579736https://leetcode.com/problems/fibonacci-number
128String to Integer (atoi)15.4%Medium0.015084664273571906https://leetcode.com/problems/string-to-integer-atoi
1356Merge Intervals39.3%Medium0.013819532422258866https://leetcode.com/problems/merge-intervals
1453Maximum Subarray46.5%Easy0.013467854269413949https://leetcode.com/problems/maximum-subarray
15273Integer to English Words27.1%Hard0.012081089250339716https://leetcode.com/problems/integer-to-english-words
1623Merge k Sorted Lists40.2%Hard0.009092808657599025https://leetcode.com/problems/merge-k-sorted-lists
175Longest Palindromic Substring29.5%Medium0.009086325220960808https://leetcode.com/problems/longest-palindromic-substring
18209Minimum Size Subarray Sum38.2%Medium0.00841401682484616https://leetcode.com/problems/minimum-size-subarray-sum
19240Search a 2D Matrix II43.2%Medium0.0075829747244553335https://leetcode.com/problems/search-a-2d-matrix-ii
2094Binary Tree Inorder Traversal63.3%Medium0.007533307577636257https://leetcode.com/problems/binary-tree-inorder-traversal
21163Sum Closest46.0%Medium0.0075259057003469075https://leetcode.com/problems/3sum-closest
22116Populating Next Right Pointers in Each Node45.2%Medium0.007336790063854334https://leetcode.com/problems/populating-next-right-pointers-in-each-node
2341First Missing Positive32.0%Hard0.0064113058208121855https://leetcode.com/problems/first-missing-positive
2424Swap Nodes in Pairs50.4%Medium0.0062218275061505365https://leetcode.com/problems/swap-nodes-in-pairs
25199Binary Tree Right Side View54.1%Medium0.0056826406650506926https://leetcode.com/problems/binary-tree-right-side-view
2620Valid Parentheses39.0%Easy0.005168860577665306https://leetcode.com/problems/valid-parentheses
27160Intersection of Two Linked Lists40.6%Easy0.004901369939720486https://leetcode.com/problems/intersection-of-two-linked-lists
28121Best Time to Buy and Sell Stock50.5%Easy0.0047725193990346675https://leetcode.com/problems/best-time-to-buy-and-sell-stock
2935Search Insert Position42.6%Easy0.004646848510375352https://leetcode.com/problems/search-insert-position
3022Generate Parentheses62.7%Medium0.0043611059090124735https://leetcode.com/problems/generate-parentheses
3146Permutations63.5%Medium0.004216302230139218https://leetcode.com/problems/permutations
32322Coin Change35.5%Medium0.004029826126500844https://leetcode.com/problems/coin-change
33238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
34102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
35101Symmetric Tree46.8%Easy0.0034057078469827435https://leetcode.com/problems/symmetric-tree
3698Validate Binary Search Tree27.8%Medium0.002943776044013381https://leetcode.com/problems/validate-binary-search-tree
37104Maximum Depth of Binary Tree66.0%Easy0.002787846801433134https://leetcode.com/problems/maximum-depth-of-binary-tree
383Longest Substring Without Repeating Characters30.4%Medium0.0015556336509412823https://leetcode.com/problems/longest-substring-without-repeating-characters