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

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2759Employee Free Time66.3%Hard1.6706917846283542https://leetcode.com/problems/employee-free-time
3811Subdomain Visit Count69.9%Easy1.2027673650415363https://leetcode.com/problems/subdomain-visit-count
4277Find the Celebrity41.8%Medium0.7348429454547184https://leetcode.com/problems/find-the-celebrity
5770Basic Calculator IV48.1%Hard0.538996500732687https://leetcode.com/problems/basic-calculator-iv
6632Smallest Range Covering Elements from K Lists52.4%Hard0.37755631999108785https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists
7362Design Hit Counter63.7%Medium0.34451909789108437https://leetcode.com/problems/design-hit-counter
8564Find the Closest Palindrome19.7%Hard0.3007541540191337https://leetcode.com/problems/find-the-closest-palindrome
9224Basic Calculator36.8%Hard0.23074173054528113https://leetcode.com/problems/basic-calculator
10269Alien Dictionary33.3%Hard0.2306743801916798https://leetcode.com/problems/alien-dictionary
11718Maximum Length of Repeated Subarray49.4%Medium0.16528289916664798https://leetcode.com/problems/maximum-length-of-repeated-subarray
12772Basic Calculator III41.3%Hard0.13720112151348504https://leetcode.com/problems/basic-calculator-iii
1368Text Justification27.7%Hard0.10627110304957266https://leetcode.com/problems/text-justification
14254Factor Combinations46.7%Medium0.10058723690516862https://leetcode.com/problems/factor-combinations
15126Word Ladder II22.1%Hard0.07011193038456472https://leetcode.com/problems/word-ladder-ii
16726Number of Atoms49.0%Hard0.06371581438610768https://leetcode.com/problems/number-of-atoms
17428Serialize and Deserialize N-ary Tree59.4%Hard0.06136894637629212https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree
18158Read N Characters Given Read4 II - Call multiple times33.8%Hard0.05800594958851697https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times
19935Knight Dialer45.2%Medium0.04445176257083384https://leetcode.com/problems/knight-dialer
20261Graph Valid Tree42.2%Medium0.03683657735649026https://leetcode.com/problems/graph-valid-tree
21698Partition to K Equal Sum Subsets45.0%Medium0.02109782896463587https://leetcode.com/problems/partition-to-k-equal-sum-subsets
22392Is Subsequence49.2%Easy0.02033508842008217https://leetcode.com/problems/is-subsequence
23341Flatten Nested List Iterator52.9%Medium0.019980684690483426https://leetcode.com/problems/flatten-nested-list-iterator
24202Happy Number50.4%Easy0.014045174703047602https://leetcode.com/problems/happy-number
25986Interval List Intersections67.3%Medium0.011969023795320735https://leetcode.com/problems/interval-list-intersections
26146LRU Cache33.2%Medium0.010321192540274932https://leetcode.com/problems/lru-cache
27380Insert Delete GetRandom O(1)47.5%Medium0.009820849864094454https://leetcode.com/problems/insert-delete-getrandom-o1
28208Implement Trie (Prefix Tree)49.4%Medium0.009105457856626612https://leetcode.com/problems/implement-trie-prefix-tree
29295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
30239Sliding Window Maximum43.0%Hard0.007898935224534491https://leetcode.com/problems/sliding-window-maximum
3114Longest Common Prefix35.4%Easy0.00745530292090591https://leetcode.com/problems/longest-common-prefix
3236Valid Sudoku48.7%Medium0.007258242715805398https://leetcode.com/problems/valid-sudoku
33127Word Ladder29.6%Medium0.005979091056058075https://leetcode.com/problems/word-ladder
3491Decode Ways24.7%Medium0.005968385368349129https://leetcode.com/problems/decode-ways
35236Lowest Common Ancestor of a Binary Tree45.7%Medium0.004714210262726446https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
36139Word Break40.1%Medium0.003894465052690167https://leetcode.com/problems/word-break
3779Word Search35.6%Medium0.003741741363018696https://leetcode.com/problems/word-search
3856Merge Intervals39.3%Medium0.0034728286335985107https://leetcode.com/problems/merge-intervals
39140Word Break II32.6%Hard0.0027070942357783584https://leetcode.com/problems/word-break-ii
40621Task Scheduler50.1%Medium0.002341784338144407https://leetcode.com/problems/task-scheduler
41210Course Schedule II40.7%Medium0.0019086707135282834https://leetcode.com/problems/course-schedule-ii