LeetCode-Questions-CompanyWise/wish_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.6 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2845Longest Mountain in Array37.2%Medium0.24328831528748193https://leetcode.com/problems/longest-mountain-in-array
3900RLE Iterator53.5%Medium0.1884471502206373https://leetcode.com/problems/rle-iterator
4388Longest Absolute File Path41.8%Medium0.18128582392042256https://leetcode.com/problems/longest-absolute-file-path
5528Random Pick with Weight43.9%Medium0.16808800301828727https://leetcode.com/problems/random-pick-with-weight
623Merge k Sorted Lists40.2%Hard0.15830321529243765https://leetcode.com/problems/merge-k-sorted-lists
742Trapping Rain Water48.9%Hard0.10346205022559302https://leetcode.com/problems/trapping-rain-water
8314Binary Tree Vertical Order Traversal45.3%Medium0.07017345555905126https://leetcode.com/problems/binary-tree-vertical-order-traversal
9200Number of Islands46.8%Medium0.05694938541936198https://leetcode.com/problems/number-of-islands
1096Unique Binary Search Trees52.9%Medium0.056410171529350385https://leetcode.com/problems/unique-binary-search-trees
11616Add Bold Tag in String43.1%Medium0.05421381659414747https://leetcode.com/problems/add-bold-tag-in-string
12695Max Area of Island62.7%Medium0.04980799142417255https://leetcode.com/problems/max-area-of-island
1348Rotate Image56.7%Medium0.04495138786226632https://leetcode.com/problems/rotate-image
1456Merge Intervals39.3%Medium0.04173304225331761https://leetcode.com/problems/merge-intervals
15146LRU Cache33.2%Medium0.040660598211268925https://leetcode.com/problems/lru-cache
16239Sliding Window Maximum43.0%Hard0.031228142547585713https://leetcode.com/problems/sliding-window-maximum
1764Minimum Path Sum54.5%Medium0.024287775531756203https://leetcode.com/problems/minimum-path-sum
1849Group Anagrams56.9%Medium0.02354157682187747https://leetcode.com/problems/group-anagrams
19128Longest Consecutive Sequence45.1%Hard0.020252717433212362https://leetcode.com/problems/longest-consecutive-sequence
20155Min Stack44.5%Easy0.01886181109797383https://leetcode.com/problems/min-stack
2137Sudoku Solver43.6%Hard0.01821543989134118https://leetcode.com/problems/sudoku-solver
226ZigZag Conversion36.3%Medium0.01726827253226344https://leetcode.com/problems/zigzag-conversion
23340Longest Substring with At Most K Distinct Characters44.1%Hard0.016122880486563188https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters
24153Find Minimum in Rotated Sorted Array45.1%Medium0.014939586916186732https://leetcode.com/problems/find-minimum-in-rotated-sorted-array
2541First Missing Positive32.0%Hard0.014368063266920193https://leetcode.com/problems/first-missing-positive
261Two Sum45.6%Easy0.013049691753224608https://leetcode.com/problems/two-sum
27172Factorial Trailing Zeroes37.8%Easy0.012326812480658571https://leetcode.com/problems/factorial-trailing-zeroes
28125Valid Palindrome36.7%Easy0.008933948641551634https://leetcode.com/problems/valid-palindrome
29207Course Schedule43.1%Medium0.004964021114211758https://leetcode.com/problems/course-schedule
30560Subarray Sum Equals K43.9%Medium0.004279454482267064https://leetcode.com/problems/subarray-sum-equals-k
312Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers
32781Rabbits in Forest54.5%Medium0https://leetcode.com/problems/rabbits-in-forest
331193Monthly Transactions I68.3%Medium0https://leetcode.com/problems/monthly-transactions-i
341205Monthly Transactions II45.0%Medium0https://leetcode.com/problems/monthly-transactions-ii