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

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2759Employee Free Time66.3%Hard2.6397139923561346https://leetcode.com/problems/employee-free-time
3811Subdomain Visit Count69.9%Easy1.9912475836494699https://leetcode.com/problems/subdomain-visit-count
4277Find the Celebrity41.8%Medium1.6067213396798519https://leetcode.com/problems/find-the-celebrity
5770Basic Calculator IV48.1%Hard0.9582549309731873https://leetcode.com/problems/basic-calculator-iv
6269Alien Dictionary33.3%Hard0.6552836497974878https://leetcode.com/problems/alien-dictionary
7362Design Hit Counter63.7%Medium0.6551596398987732https://leetcode.com/problems/design-hit-counter
8224Basic Calculator36.8%Hard0.5668534552356532https://leetcode.com/problems/basic-calculator
9632Smallest Range Covering Elements from K Lists52.4%Hard0.5071491490366821https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists
1068Text Justification27.7%Hard0.37052394220493184https://leetcode.com/problems/text-justification
11564Find the Closest Palindrome19.7%Hard0.3007541540191337https://leetcode.com/problems/find-the-closest-palindrome
12254Factor Combinations46.7%Medium0.21357410029805904https://leetcode.com/problems/factor-combinations
13126Word Ladder II22.1%Hard0.2008357460092558https://leetcode.com/problems/word-ladder-ii
14718Maximum Length of Repeated Subarray49.4%Medium0.16528289916664798https://leetcode.com/problems/maximum-length-of-repeated-subarray
15146LRU Cache33.2%Medium0.15357414478678588https://leetcode.com/problems/lru-cache
16158Read N Characters Given Read4 II - Call multiple times33.8%Hard0.15348688956060175https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times
17772Basic Calculator III41.3%Hard0.13720112151348504https://leetcode.com/problems/basic-calculator-iii
18202Happy Number50.4%Easy0.11982401289364229https://leetcode.com/problems/happy-number
19392Is Subsequence49.2%Easy0.07897107508821988https://leetcode.com/problems/is-subsequence
20341Flatten Nested List Iterator52.9%Medium0.07763353611776078https://leetcode.com/problems/flatten-nested-list-iterator
21726Number of Atoms49.0%Hard0.06371581438610768https://leetcode.com/problems/number-of-atoms
22428Serialize and Deserialize N-ary Tree59.4%Hard0.06136894637629212https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree
23295Find Median from Data Stream44.3%Hard0.05495888428075748https://leetcode.com/problems/find-median-from-data-stream
2436Valid Sudoku48.7%Medium0.04452302288876419https://leetcode.com/problems/valid-sudoku
25935Knight Dialer45.2%Medium0.04445176257083384https://leetcode.com/problems/knight-dialer
2656Merge Intervals39.3%Medium0.04173304225331761https://leetcode.com/problems/merge-intervals
2779Word Search35.6%Medium0.0408086655410548https://leetcode.com/problems/word-search
28261Graph Valid Tree42.2%Medium0.03683657735649026https://leetcode.com/problems/graph-valid-tree
29127Word Ladder29.6%Medium0.03679590970204585https://leetcode.com/problems/word-ladder
3091Decode Ways24.7%Medium0.023662742620848144https://leetcode.com/problems/decode-ways
31698Partition to K Equal Sum Subsets45.0%Medium0.02109782896463587https://leetcode.com/problems/partition-to-k-equal-sum-subsets
32208Implement Trie (Prefix Tree)49.4%Medium0.02037191321634931https://leetcode.com/problems/implement-trie-prefix-tree
33139Word Break40.1%Medium0.015487677691351377https://leetcode.com/problems/word-break
34986Interval List Intersections67.3%Medium0.011969023795320735https://leetcode.com/problems/interval-list-intersections
35236Lowest Common Ancestor of a Binary Tree45.7%Medium0.010575891759058162https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
36380Insert Delete GetRandom O(1)47.5%Medium0.009820849864094454https://leetcode.com/problems/insert-delete-getrandom-o1
37239Sliding Window Maximum43.0%Hard0.007898935224534491https://leetcode.com/problems/sliding-window-maximum
3814Longest Common Prefix35.4%Easy0.00745530292090591https://leetcode.com/problems/longest-common-prefix
39210Course Schedule II40.7%Medium0.0042893974831731225https://leetcode.com/problems/course-schedule-ii
40140Word Break II32.6%Hard0.0027070942357783584https://leetcode.com/problems/word-break-ii
41621Task Scheduler50.1%Medium0.002341784338144407https://leetcode.com/problems/task-scheduler
42571Find Median Given Frequency of Numbers44.7%Hard0https://leetcode.com/problems/find-median-given-frequency-of-numbers
43720Longest Word in Dictionary48.2%Easy0https://leetcode.com/problems/longest-word-in-dictionary