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

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2811Subdomain Visit Count69.9%Easy2.447028162023433https://leetcode.com/problems/subdomain-visit-count
3770Basic Calculator IV48.1%Hard1.9937403768488644https://leetcode.com/problems/basic-calculator-iv
4829Consecutive Numbers Sum37.5%Hard1.5906860988778346https://leetcode.com/problems/consecutive-numbers-sum
5224Basic Calculator36.8%Hard1.1373983137032662https://leetcode.com/problems/basic-calculator
61163Last Substring in Lexicographical Order33.9%Hard0.7261919753374027https://leetcode.com/problems/last-substring-in-lexicographical-order
71297Maximum Number of Occurrences of a Substring47.3%Medium0.40882645581086924https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring
81328Break a Palindrome43.3%Medium0.21795507637539235https://leetcode.com/problems/break-a-palindrome
91248Count Number of Nice Subarrays56.4%Medium0.17228309044709728https://leetcode.com/problems/count-number-of-nice-subarrays
101290Convert Binary Number in a Linked List to Integer80.4%Easy0.0913181585347874https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer
11146LRU Cache33.2%Medium0.07118067822062889https://leetcode.com/problems/lru-cache
12212Word Search II34.9%Hard0.05999879858378973https://leetcode.com/problems/word-search-ii
13239Sliding Window Maximum43.0%Hard0.0483746857022364https://leetcode.com/problems/sliding-window-maximum
14647Palindromic Substrings60.6%Medium0.040968350772541844https://leetcode.com/problems/palindromic-substrings
1517Letter Combinations of a Phone Number46.8%Medium0.03893646375009422https://leetcode.com/problems/letter-combinations-of-a-phone-number
1637Sudoku Solver43.6%Hard0.01821543989134118https://leetcode.com/problems/sudoku-solver
1736Valid Sudoku48.7%Medium0.01625758350956095https://leetcode.com/problems/valid-sudoku
185Longest Palindromic Substring29.5%Medium0.009086325220960808https://leetcode.com/problems/longest-palindromic-substring
19200Number of Islands46.8%Medium0.0028897578265903614https://leetcode.com/problems/number-of-islands
201Two Sum45.6%Easy0.0008206138651873125https://leetcode.com/problems/two-sum
211282Group the People Given the Group Size They Belong To83.9%Medium0https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to
221280Students and Examinations72.2%Easy0https://leetcode.com/problems/students-and-examinations
231364Number of Trusted Contacts of a Customer75.5%Medium0https://leetcode.com/problems/number-of-trusted-contacts-of-a-customer