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

2.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2609Find Duplicate File in System59.5%Medium5.67594859888821https://leetcode.com/problems/find-duplicate-file-in-system
3289Game of Life54.5%Medium4.950737575757486https://leetcode.com/problems/game-of-life
4924Minimize Malware Spread42.0%Hard4.0636699251252715https://leetcode.com/problems/minimize-malware-spread
5379Design Phone Directory46.8%Medium3.4802548518846486https://leetcode.com/problems/design-phone-directory
6291Word Pattern II43.4%Hard3.080206637191811https://leetcode.com/problems/word-pattern-ii
7362Design Hit Counter63.7%Medium2.7212063428291313https://leetcode.com/problems/design-hit-counter
8928Minimize Malware Spread II40.5%Hard1.8341386921969165https://leetcode.com/problems/minimize-malware-spread-ii
91242Web Crawler Multithreaded45.9%Medium1.7713921664036212https://leetcode.com/problems/web-crawler-multithreaded
101178Number of Valid Words for Each Puzzle37.8%Hard1.0828639316999706https://leetcode.com/problems/number-of-valid-words-for-each-puzzle
111001Grid Illumination35.9%Hard1.0479685558493548https://leetcode.com/problems/grid-illumination
12642Design Search Autocomplete System44.7%Hard0.9534648850908103https://leetcode.com/problems/design-search-autocomplete-system
1317Letter Combinations of a Phone Number46.8%Medium0.8219594485525382https://leetcode.com/problems/letter-combinations-of-a-phone-number
14290Word Pattern37.0%Easy0.3813449098066498https://leetcode.com/problems/word-pattern
151236Web Crawler64.3%Medium0.33647223662121295https://leetcode.com/problems/web-crawler
16146LRU Cache33.2%Medium0.31735278471778255https://leetcode.com/problems/lru-cache
171010Pairs of Songs With Total Durations Divisible by 6047.4%Easy0.09171392769013605https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60
18140Word Break II32.6%Hard0.07881168148917794https://leetcode.com/problems/word-break-ii
191Two Sum45.6%Easy0.016487580637467636https://leetcode.com/problems/two-sum
204Median of Two Sorted Arrays29.6%Hard0.015510198481701449https://leetcode.com/problems/median-of-two-sorted-arrays
2164Minimum Path Sum54.5%Medium0.013734383449598314https://leetcode.com/problems/minimum-path-sum
2228Implement strStr()34.5%Easy0.008850485542574548https://leetcode.com/problems/implement-strstr
231250Check If It Is a Good Array55.7%Hard0https://leetcode.com/problems/check-if-it-is-a-good-array