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

3.3 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
29233Sum With Multiplicity35.7%Medium3.6540779400095724https://leetcode.com/problems/3sum-with-multiplicity
3855Exam Room43.1%Medium2.227706389329833https://leetcode.com/problems/exam-room
4297Serialize and Deserialize Binary Tree47.5%Hard0.8013348386500929https://leetcode.com/problems/serialize-and-deserialize-binary-tree
5525Contiguous Array42.8%Medium0.661321343774057https://leetcode.com/problems/contiguous-array
6437Path Sum III47.2%Medium0.5566603463186759https://leetcode.com/problems/path-sum-iii
7498Diagonal Traverse48.2%Medium0.3533581913127385https://leetcode.com/problems/diagonal-traverse
814Longest Common Prefix35.4%Easy0.276319223139963https://leetcode.com/problems/longest-common-prefix
9253Meeting Rooms II45.7%Medium0.24508053019079523https://leetcode.com/problems/meeting-rooms-ii
10113Path Sum II46.7%Medium0.2114436333734406https://leetcode.com/problems/path-sum-ii
111053Previous Permutation With One Swap48.5%Medium0.20067069546215116https://leetcode.com/problems/previous-permutation-with-one-swap
121329Sort the Matrix Diagonally78.4%Medium0.14787032803970862https://leetcode.com/problems/sort-the-matrix-diagonally
13162Find Peak Element43.3%Medium0.14169934441669452https://leetcode.com/problems/find-peak-element
141027Longest Arithmetic Sequence53.4%Medium0.11122563511022437https://leetcode.com/problems/longest-arithmetic-sequence
1531Next Permutation32.6%Medium0.11042119699719148https://leetcode.com/problems/next-permutation
16380Insert Delete GetRandom O(1)47.5%Medium0.1088270483839184https://leetcode.com/problems/insert-delete-getrandom-o1
17452Minimum Number of Arrows to Burst Balloons49.6%Medium0.10828689439229534https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons
18852Peak Index in a Mountain Array71.6%Easy0.10417042076751157https://leetcode.com/problems/peak-index-in-a-mountain-array
19780Reaching Points29.4%Hard0.1040197878075301https://leetcode.com/problems/reaching-points
20390Elimination Game44.5%Medium0.0922312242160336https://leetcode.com/problems/elimination-game
2148Rotate Image56.7%Medium0.058128316417041546https://leetcode.com/problems/rotate-image
22153Sum26.8%Medium0.04132186956190618https://leetcode.com/problems/3sum
2339Combination Sum56.1%Medium0.033569210052752915https://leetcode.com/problems/combination-sum
241Two Sum45.6%Easy0.01579380422752371https://leetcode.com/problems/two-sum
25560Subarray Sum Equals K43.9%Medium0.00407664649376343https://leetcode.com/problems/subarray-sum-equals-k
26198House Robber42.0%Easy0.003611415987216383https://leetcode.com/problems/house-robber
277171-bit and 2-bit Characters48.8%Easy0https://leetcode.com/problems/1-bit-and-2-bit-characters
281256Encode Number66.1%Medium0https://leetcode.com/problems/encode-number
291281Subtract the Product and Sum of Digits of an Integer85.2%Easy0https://leetcode.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer
301295Find Numbers with Even Number of Digits81.5%Easy0https://leetcode.com/problems/find-numbers-with-even-number-of-digits
311354Construct Target Array With Multiple Sums31.9%Hard0https://leetcode.com/problems/construct-target-array-with-multiple-sums