LeetCode-Questions-CompanyWise/sap_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
21349Maximum Students Taking Exam42.0%Hard0.290115411660895https://leetcode.com/problems/maximum-students-taking-exam
31341Movie Rating56.6%Medium0.20386340056870947https://leetcode.com/problems/movie-rating
41Two Sum45.6%Easy0.19075536634731924https://leetcode.com/problems/two-sum
51283Find the Smallest Divisor Given a Threshold47.6%Medium0.10450335525513373https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
6146LRU Cache33.2%Medium0.08926627755405464https://leetcode.com/problems/lru-cache
7738Monotone Increasing Digits44.3%Medium0.08479653666007693https://leetcode.com/problems/monotone-increasing-digits
8283Move Zeroes57.8%Easy0.05686540295029014https://leetcode.com/problems/move-zeroes
95Longest Palindromic Substring29.5%Medium0.05548042005986785https://leetcode.com/problems/longest-palindromic-substring
10240Search a 2D Matrix II43.2%Medium0.04647676584572884https://leetcode.com/problems/search-a-2d-matrix-ii
118String to Integer (atoi)15.4%Medium0.04549614908874012https://leetcode.com/problems/string-to-integer-atoi
12509Fibonacci Number67.2%Easy0.04365218172593638https://leetcode.com/problems/fibonacci-number
13160Intersection of Two Linked Lists40.6%Easy0.043270781043381126https://leetcode.com/problems/intersection-of-two-linked-lists
14559Maximum Depth of N-ary Tree68.7%Easy0.04319159858277399https://leetcode.com/problems/maximum-depth-of-n-ary-tree
151048Longest String Chain54.7%Medium0.04304825356851367https://leetcode.com/problems/longest-string-chain
1653Maximum Subarray46.5%Easy0.04299340685592046https://leetcode.com/problems/maximum-subarray
1756Merge Intervals39.3%Medium0.04173304225331761https://leetcode.com/problems/merge-intervals
1820Valid Parentheses39.0%Easy0.03618871742239114https://leetcode.com/problems/valid-parentheses
19209Minimum Size Subarray Sum38.2%Medium0.033239453928687726https://leetcode.com/problems/minimum-size-subarray-sum
20917Reverse Only Letters58.0%Easy0.0286552557603761https://leetcode.com/problems/reverse-only-letters
21322Coin Change35.5%Medium0.024924029676386045https://leetcode.com/problems/coin-change
22199Binary Tree Right Side View54.1%Medium0.022539339846061532https://leetcode.com/problems/binary-tree-right-side-view
23121Best Time to Buy and Sell Stock50.5%Easy0.018954919107260947https://leetcode.com/problems/best-time-to-buy-and-sell-stock
243Longest Substring Without Repeating Characters30.4%Medium0.018891763947827014https://leetcode.com/problems/longest-substring-without-repeating-characters
2523Merge k Sorted Lists40.2%Hard0.016108271385328228https://leetcode.com/problems/merge-k-sorted-lists
26102Binary Tree Level Order Traversal54.6%Medium0.014477270588287548https://leetcode.com/problems/binary-tree-level-order-traversal
2724Swap Nodes in Pairs50.4%Medium0.013945066390122038https://leetcode.com/problems/swap-nodes-in-pairs
2894Binary Tree Inorder Traversal63.3%Medium0.013353561806134713https://leetcode.com/problems/binary-tree-inorder-traversal
29273Integer to English Words27.1%Hard0.012081089250339716https://leetcode.com/problems/integer-to-english-words
3098Validate Binary Search Tree27.8%Medium0.01172346369605921https://leetcode.com/problems/validate-binary-search-tree
3146Permutations63.5%Medium0.009461803137288448https://leetcode.com/problems/permutations
32163Sum Closest46.0%Medium0.0075259057003469075https://leetcode.com/problems/3sum-closest
33116Populating Next Right Pointers in Each Node45.2%Medium0.007336790063854334https://leetcode.com/problems/populating-next-right-pointers-in-each-node
3441First Missing Positive32.0%Hard0.0064113058208121855https://leetcode.com/problems/first-missing-positive
35104Maximum Depth of Binary Tree66.0%Easy0.006261761223976207https://leetcode.com/problems/maximum-depth-of-binary-tree
3635Search Insert Position42.6%Easy0.004646848510375352https://leetcode.com/problems/search-insert-position
3722Generate Parentheses62.7%Medium0.0043611059090124735https://leetcode.com/problems/generate-parentheses
38238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
39101Symmetric Tree46.8%Easy0.0034057078469827435https://leetcode.com/problems/symmetric-tree